How to use in operator
Database
21
Posts
5
Posters
0
Views
1
Watching
-
Yes we can put a select statement inside the IN expression but if the column contains a list of values separated by comma(,) then it will not work.now the table data is like this table1 col1 hyderabad delhi mumbai table2 col1 hyderabad,chennai,bangalore bangalore,kolkata,delhi bangalore mumbai,hyderabad now if I give select * from table1 where col1 in (select col1 from table2) i will not get the output can u checkl it once Regards, Uma
http://www.projectdmx.com/tsql/sqlarrays.aspx[^] You should be able to use CharIndex as the article in the link above suggests as one solution. select t1.* from table1 t1 join table2 t2 on charindex(',' + t1.col1 + ',' , ',' + t2.col1 + ',') > 0