|
我想这样写语句: select * from item where item_id ? ('001','003','006') ? 应该用什么函数 |
|
|
|
select * from item where item_id in ('001','003','006')
|
|
|
in
|
|
|
select * from item where item_id in ('001','003','006')
|
|
|
IN
|
|
|
select * from item where item_id=001' or item_id='003' or item_id='006'
或者 select * from item where item_id in ('001','003','006') 对比 OR 和 IN 下面的示例选择名称和州的列表,列表中列出所有居住在加利福尼亚、印地安纳或马里兰州的作者。 USE pubs SELECT au_lname, state FROM authors WHERE state = 'CA' OR state = 'IN' OR state = 'MD' 但是,也可以使用 IN 获得相同的结果: USE pubs SELECT au_lname, state FROM authors WHERE state IN ('CA', 'IN', 'MD') |
|