开发者

Result id from database by mysql?

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)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜