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 |
|
M2
Starting Member
22 Posts |
Posted - 2002-06-13 : 05:30:32
|
| I want to retrieve NAME, which having the similarity. Other then LIKE, do have any other method to compare it?Example: Table A: Name------------------------------------------------- LIM AH KAUSHAMINI A/P GURUSAMYABDUL HALIM BIN ABDUL MAJID ABDUL RAHIM BIN ATANTable B:Name--------------------BIN ATANSTEVEN LIM AH KAUABDUL HALIMScript:Select * from TableA, TableBWhere TableB.Name like '%' + TableA.Name + '%'Result only display:Name Name----------------------------------------------------LIM AH KAU STEVEN LIM AH KAU I know that ABDUL HALIM BIN ABDUL MAJID and ABDUL HALIM is the same person. However, if I use above method, the result do not display it.Do have any method that can find out the similarity of two records from different table? |
|
|
Wanderer
Master Smack Fu Yak Hacker
1168 Posts |
Posted - 2002-06-13 : 05:57:58
|
| well, just expanding on your query:Select * from TableA, TableB Where TableB.Name like '%' + TableA.Name + '%' to the following :Select * from TableA, TableB Where (TableB.Name like '%' + TableA.Name + '%' )or (TableA.name like '%' + tableB.Name + '%' )will include the missing row I think ( I haven't tested, some you should do so). |
 |
|
|
M2
Starting Member
22 Posts |
Posted - 2002-06-13 : 22:45:44
|
| I also do like that before, but still cant get what I want ! Do have any other method? |
 |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2002-06-14 : 07:55:45
|
| You might need to trim the expressions before you do the comparison. It seems your query should work. What is the date type for the [name] column in the two tables?Can you just please post the create table statements(ddl) and the insert statements(dml) necessary to reproduce your problem?<O> |
 |
|
|
|
|
|