开发者

How do I list multiple items in MySQL?

What is the proper syntax for the below code:

SELECT * FROM this WHERE x = 'y' AND id != '10, 11, 143'

The part I am开发者_开发技巧 not sure about is listing multiple IDs.


if id is numeric, you can use

SELECT * FROM this WHERE x = 'y' AND id not in (10,11,143)

or

SELECT * FROM this WHERE x = 'y' AND id not in ('10','11','143')

for strings.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜