SQL语句 一个字段查询两个条件

SQL查询语句,同一字段上做两个条件怎么写啊?就好比服装,有帽子,T恤,裤子,鞋,我想查出来裤子和鞋的所有产品型号,T恤和帽子不查。

select * from [表名] where [字段名] in ('裤子','鞋')
就是这个
*代表查询所有的内容,如果你只要查询产品型号的话就把*改成字段名产品弄号。
温馨提示:答案为网友推荐,仅供参考
第1个回答  2017-06-16
用 not in
比如:select * from table where type not in (‘帽子’,‘T恤')
第2个回答  2013-10-10
select * from table1 where time between time1 and time2

select a,b,c, from table1 where a not between 数值1 and 数值2


select * from table1 where a [not] in (‘值1’,’值2’,’值4’,’值6’)
第3个回答  2013-10-10
服装 = "裤子" OR 服装 = "鞋"