1.组合WHERE子句

Mysql基础第十天,数据过滤_操作符

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操作符

Mysql基础第十天,数据过滤_操作符_02

select vend_name,vend_city from vendors where vend_city in ('New York','Lundon','paris');  // in 查询

3. NOT 操作符

Mysql基础第十天,数据过滤_操作符_03

select vend_name,vend_city from vendors where vend_city not in ('New York','Lundon','paris');  // not 查询

4.小结

Mysql基础第十天,数据过滤_操作符_04

感谢观看