Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
jonathan.hoang
Starting Member
2 Posts |
Posted - 2012-08-10 : 18:20:42
|
Hello,I'm new to SQL and I ran into a problem how to select the closest match?For example if I have a table Chart which has three columns (Code, Modifier, MappingCode)let say it has the following rows:1) 1110, 50, xxxxx2) 1110, null, yyyyy3) 2220, 50, zzzzzand the input example are:1) 1110 - the closest match we want is row 22) 1110,50 - the closest match we want is row 13) 2220 - the closest match we want is row 3 Thanks for your help,-Jonathan |
|
yosiasz
Master Smack Fu Yak Hacker
1635 Posts |
Posted - 2012-08-10 : 18:38:30
|
are code and modifier always int?<><><><><><><><><><><><><><><><><>If you don't have the passion to help people, you have no passion |
 |
|
jonathan.hoang
Starting Member
2 Posts |
Posted - 2012-08-10 : 18:47:15
|
There both Char defined. Sorry, I did not explain correctly. Thanks. |
 |
|
|
|
|