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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-05-23 : 08:59:48
|
| Collin writes "i have tried to do a query between 2 different tables that have different columns. within both these tables there is a column that has a column name different from the column name of the other table but the data within both columns is the same. i wanted a query that compares the data between the 2 tables.Example is:Table 1 Columns : firstname , age , id , grade.Table 2Columns : name, sex , school.lets say that the data of column "firstname" of table 1 contains the same data as column "name" of table 2 and i would want to do a query that retrieves records for where data in the column "firstname" in table 1 is found in column "name" of table 2.sql server 2000 with service pack 3 running on windows 2003 server service pack 1Rgds,Mr. C. " |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
cmdr_skywalker
Posting Yak Master
159 Posts |
Posted - 2006-05-23 : 13:13:25
|
| in general, you might want to standardize the data domain (fullname vs last/first/middle names) to make sure that your matching algorithm follows the same assumptions. in SQL, you can use JOINS, CHAINDEX, PATINDEX, IN, LIKE, SOUNDEX, etc. to find out if a column is the same (or partially the same) with the other column.May the Almighty God bless us all! |
 |
|
|
|
|
|
|
|