Reputation: 221
In my database there are fields where values like this:
14,20,12,13,1,22,28,23,5,3,30,15
I want to take that have a value 20
.
I tried to do like this:
SELECT * FROM USER WHERE 20 IN (expertise)
so but returns those lines which begin with 20
Upvotes: 2
Views: 43
Reputation: 5356
SELECT * FROM USER WHERE expertise=20
OR
SELECT * FROM USER WHERE expertise IN (20)
OR If you have comma seperated values
SELECT * FROM USER WHERE expertise like "%20%"
Upvotes: 1