更多查询
带比较操作符
大于:>
小于:<
大于等于:>=
小于等于:<=
不等于:<>或者!=
示例:查询所有订单金额大于200的订单
select * from orders where amt > 200
逻辑运算符
and:多个条件同时满足时输出
or:满足任意一个条件就输出
示例:
查询客户名称为"zs"且金额大于200的订单
select * from orders where cust_name = "zs" and amt > 200;
查询订单号为1或者2,金额大于200的订单
select * from orders where (order_id = 1 or order_id =2) and amt >200;
范围比较
(1)between……and……
示例:查找订单金额在200到300之间的订单
select * from orders where amt between 200 and 300;
(2)in / not in
示例:查找订单客户除了"David"的订单
select * from orders where cust_name not in (&