1

我只是想问一下wheremysql中的子句是否可以有多个参数?

就像是:

SELECT * from tblId where id=1,2,3,4

假设我只想选择 id's 1, 2, 3, 4. 我试过这个但给我错误。谢谢您的帮助 :)

4

4 回答 4

7
SELECT * FROM tblId WHERE id IN (1, 2, 3, 4);
于 2013-06-06T09:56:28.827 回答
2

试试这个查询:

SELECT * from tblId where id in (1,2,3,4)
于 2013-06-06T09:56:50.413 回答
1

尝试in

SELECT * from tblId where id in (1,2,3,4)
于 2013-06-06T09:56:33.577 回答
-4

试试这个 SELECT * from tblId where id =1 and id =2 and id =3 and id =4

于 2013-06-06T10:02:14.310 回答