I have a column in database saved as id like 1,12,10 and I 开发者_C百科want to return only one id like 1 or 12 or 10 when use like will return wrong data? What can I do?
You can use LIMIT
.
SELECT col FROM table_name LIMIT 1
This will only return one result.
However you are claiming that it is returning the wrong results, which we can't help if you don't post more.
Update
as per your comment, you want to use IN
SELECT col FROM table_name WHERE id IN (10, 12, 1)
精彩评论