Issue
In my table, one of the column has comma separated values. I would like to select the entry based on one or two values if found in that column like
select * from table where tags contains ('ec2' or 'associate')
or contains multiple values
select * from table where tags contains 's3' and 'rds'
What is the right query?
Solution
You can use the in-built find_in_set
function.
find_in_set('s3',tags) > 0 and find_in_set('rds',tags) > 0
Answered By - Vamsi Prabhala Answer Checked By - Timothy Miller (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.