0

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

Paul White
  • 83,961
  • 28
  • 402
  • 634
  • When you say "Unfortunately, it is not working", please tell us WHY it's not working. Also, please provide more information regarding your comment about "Data should not be duplicated". Do you just need to modify your query to be SELECT DISTINCT * FROM table where...? Providing sample input data and expected output will allow us to provide a more complete answer. – Scott Hodgin - Retired Aug 11 '17 at 09:06

1 Answers1

2

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

Paweł Tajs
  • 1,353
  • 8
  • 16