Thursday, August 8, 2013

Check comma separated values exist within the column having comma separated data





 If you want to select records from table which having match some text in comma sperated list given by user with the values within the column of table having also data in comma seperated manner you can do query over table like below.


Select * from Table1

WHERE          exists(select val from Split([Column1],',') where val in (select val from Split(@CommaSeperatedList,',') ))

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More