Comparision in SQl Server
-
Hi, I have two tables A and B. A have a column col1 with list of values comma separated. B also has a column col2 with list of values comma separated. Now I should get records joining on both the columns where values in col1 = values in col2 all the values should match.How can I achieve this. For example. table A col1 delhi,chennai,kolkata,mumbai delhi,mumbai delhi,chennai table B col2 delhi,mumbai now i want to get all the records from table A where ever the column col1 has both delhi and mumbai this is my problem. Regards, Uma
-
Hi, I have two tables A and B. A have a column col1 with list of values comma separated. B also has a column col2 with list of values comma separated. Now I should get records joining on both the columns where values in col1 = values in col2 all the values should match.How can I achieve this. For example. table A col1 delhi,chennai,kolkata,mumbai delhi,mumbai delhi,chennai table B col2 delhi,mumbai now i want to get all the records from table A where ever the column col1 has both delhi and mumbai this is my problem. Regards, Uma
SELECT TABLEA.COL1,TABLEB.COL2 FROM TABLEA INNERJOIN TABLEB ON TABLEA.COL1 = TABLEB.COL2
-
Hi, I have two tables A and B. A have a column col1 with list of values comma separated. B also has a column col2 with list of values comma separated. Now I should get records joining on both the columns where values in col1 = values in col2 all the values should match.How can I achieve this. For example. table A col1 delhi,chennai,kolkata,mumbai delhi,mumbai delhi,chennai table B col2 delhi,mumbai now i want to get all the records from table A where ever the column col1 has both delhi and mumbai this is my problem. Regards, Uma