Mysql基础第十天,数据过滤
原创
©著作权归作者所有:来自51CTO博客作者2019ab的原创作品,请联系作者获取转载授权,否则将追究法律责任
1.组合WHERE子句
select prod_name,vend_id,prod_price from products where vend_id=1003 and prod_price=2.5; // 使用and
select prod_name,vend_id,prod_price from products where vend_id=1010 or prod_price>=10; // 使用or
select prod_name,vend_id,prod_price from products where vend_id=1002 and vend_id=1003 or prod_price>=10; // 使用and和or
2.in操作符
select vend_name,vend_city from vendors where vend_city in ('New York','Lundon','paris'); // in 查询
3. NOT 操作符
select vend_name,vend_city from vendors where vend_city not in ('New York','Lundon','paris'); // not 查询
4.小结
感谢观看