开发者

MySQL Select Multiple VALUES

Totally out of ideas here, could be needing a simple solution.

Basically my desired query is :

SELECT * FROM table WHERE id = 3,4

I want to select on开发者_开发技巧ly the row which has ID 3 and 4, or maybe name "andy" and "paul"

Thank you very much for the answer


Try or:

WHERE id = 3 or id = 4

Or the equivalent in:

WHERE id in (3,4)


Try this -

 select * from table where id in (3,4) or [name] in ('andy','paul');
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜