Sql-server – How to fetch records from table which has csv

csvsql serverstring-searching

Please guide me about following case. I need to fetch records from a table which has a column like shown in the picture. I need to fetch records which has 065 and AMT campaigns only.

I tried:

SELECT * FROM table WHERE Campaigns LIKE '%AMT%' OR '%065%'

Unfortunately, it is not working. Data should not be duplicated.

SQL Reference Screenshot

Best Answer

Easiest way to achive this could be:

SELECT * FROM table WHERE Campaigns LIKE '%AMT%' OR Campaigns LIKE '%065%'

You can also look at this answer:

https://dba.stackexchange.com/a/170603/74024