I am using sql server. I have a table
Company
ABC
XYZ
ABC,XYZ
When I run a like query where company like '%ABC%' I get the record containing only ABC and not ABC,XYZ
How to get both the records?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
First, you should not contain comma separated list in one column. Doing so, you will run into issues trying to query the data.
Second, your code should work:
See a SQL Fiddle with a Demo