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 |
|
dbads10
Starting Member
4 Posts |
Posted - 2011-08-02 : 05:22:23
|
| Hello,I need to write a sql statement that accesses 2 tables as follows:Table_A:Col1|Col2|Col3111|"AAA","BBB","CCC"|Modify222|"DDD","CCC","EEE", "FFF"|Modify333|"DDD","CCC","GG_GG"|Modify444|"DDD","HHH","III","JJJJ"|Modify555| 24875,97827,82474|ModifyTable_B:Object_ID|Object_Name1|BBB2|FFF3|JJJJ4|KKK5|LLLL6|GG_GGThe query result should be:Table_A.Col1|Table_B.Object_Name111|BBB222|FFF333|GG_GG444|JJJJi.e.: the query should search Table_A.Col2 for values from Table_B.Object_NameThe query should be able to run from a normal sql client (SQL Server 2008 R2)Thanks,Diaa |
|
|
dbads10
Starting Member
4 Posts |
Posted - 2011-08-02 : 06:34:11
|
| I don't know why I was struggling with this. Here is the query:SELECT Table_A.Col1, Table_B.Object_NameFROM Table_A, Table_Bwhere Table_A.Col2 like '%"' + Table_B.Object_Name + '"%'Thanks |
 |
|
|
|
|
|
|
|