SQL语句where多条件查询怎么写?

比如说我想查询表A 中的字段B中含有‘1’ ‘2’ ‘3’这三个值的所有记录?
补充一下 表A中另外一个字段 C
我想查询表A 中的字段B中含有‘1’ ‘2’ ‘3’这三个值但C字段不含有‘4’的所有记录

工具/材料:以Management Studio为例。

1、首先在桌面上,点击“Management Studio”图标。

2、然后在该界面中,点击右上角“新建查询”选项。

3、之后在该界面中,输入where多条件查询的SQL语句“selec t * from rss where grade >90 and No=20”。

4、接着在该界面中,点击“执行”按钮。

5、最后在该界面中,显示where多条件查询成功。

温馨提示:答案为网友推荐,仅供参考
第1个回答  推荐于2018-02-28
select * from a where b in(‘1’ , ‘2’, ‘3’) and c <> '4'本回答被提问者和网友采纳
第2个回答  2011-07-25
select * from a where (b like '%1%' or b like '%2%' or b like '%3%') and c not like '%4%'
select * from a where (b=1 or b=2 or b=3) and c!=4
第3个回答  2011-07-25
select * from 表A where B in('1','2','3') and C<>'4'
第4个回答  2011-07-26
where table a.b in(1.2.3)