Reputation: 153
I need something like this:
SELECT * FROM `table` WHERE '123' IN (`column`)
In 'column' (varchar 255 field) there are some numbers like 1, 50, 145, 123, 58,
I don't know to explain better, but I think you understand what I need.
Upvotes: 0
Views: 1120
Reputation: 6950
try find_in_set
SELECT * FROM table WHERE find_in_set('123',column)
Upvotes: 1
Reputation: 1453
SELECT * FROM table WHERE FIND_IN_SET('123', column);
See http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_find-in-set
Upvotes: 5