My column value like this. I want to search the value 1 from the given column.
SELECT * FROM `tbl_test` WHERE `userServices` LIKE '%1%' LIMIT 0 , 30
But the above query gives me two values row 2 and 3
My column value like this. I want to search the value 1 from the given column.
SELECT * FROM `tbl_test` WHERE `userServices` LIKE '%1%' LIMIT 0 , 30
But the above query gives me two values row 2 and 3
Use FIND_IN_SET
.
The below query should work for you.
SELECT * FROM `tbl_test` WHERE find_in_set('1', `userServices`) <> 0;