I have records in user table in following manner
id name address keywords
1 thompsan paris 10,20,30
2 samson paris 10,20,30
3 Nilawa paris 10,20,30
4 Nalama paris 100,30,50
5 Nalama paris 100,300,20
I need to get the users who have the keywords of 10 or 20. I have written this query:
SELECT * from User where keywords REGEXP '[[:<:]]10|20[[:>:]]'
It does not give me the expected output. It should filter for id 10 or 20 and give me the output of record 1,2,3,5. record 4 is not matching here.
Why is it not working? Is there a better way to do this?