SQL学习整理(四)过滤数据
select prod_name, prod_price
from Products
where prod_price = 3.49
from Products
where prod_name <> A
from Products
where prod_price between 5 and 10
from Products
where prod_price is null
使用select语句的where子语句指定搜索条件。
目录SQL学习整理四过滤数据 目录 使用where子语句指定搜索条件进行过滤 where子语句操作符
1. 使用where子语句指定搜索条件进行过滤select prod_name, prod_price
from Products
where prod_price = 3.49
将prod_price数据中等于3.49的挑选处理。
2. where子语句操作符就是说明where子语句后面跟的操作。举三个例子:
select prod_name, prod_pricefrom Products
where prod_name <> A
选择不等于A的全部记录,也可以用!=。
select prod_name, prod_pricefrom Products
where prod_price between 5 and 10
选择价格在5到10之间的商品。
select prod_name, prod_pricefrom Products
where prod_price is null
返回空字段的prod_price.