-1

The below is my table output. I wanted to find the result with using multiple string that contains in the result.

for example: I need to get result that contain ["how", "are", "you"]

column A
-----------------
how are you?
How about you?
how are you going?
how are you doing?
What up?
What is up?
Are you alright?
5
  • Does the result has to contain all the 3 words or just one of those words ? Commented Oct 2, 2017 at 3:00
  • Need to know both the query 1) With anyone word 2) With all the words Commented Oct 2, 2017 at 3:02
  • you can create dynamic query with conditions joined by OR Commented Oct 2, 2017 at 3:04
  • As Tim said in comments to deleted answer, you can use full text search stackoverflow.com/a/6506489/7974050 Commented Oct 2, 2017 at 3:09
  • select * from tablename where [column A] like '%how%' or [column A] like '%are%' or [column A] like '%you%' Commented Oct 2, 2017 at 3:29

1 Answer 1

1

Any one of the words

select * from tablename where [column A] like '%how%' or [column A] like '%are%' or [column A] like '%you%' 

All the words

select * from tablename where [column A] like '%how%' and [column A] like '%are%' and [column A] like '%you%' 

All the words together

select * from tablename where [column A] like '%how are you%' 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.