数据表格,创造数据都在上篇文章MySQL常用语句里,可以在我的栏目里看到。
select语句的where子句可以指定搜索条件。
select prod_name,prod_price from products where prod_price = 3.49;
查询小于10美元的产品
select prod_name,prod_price from products where prod_price <10;
查询不是DLL01制造的产品
select vend_id,prod_name from products where vend_id <> 'DLL01';
select vend_id,prod_name from products where vend_id != 'DLL01';
查询大于5美元小于10美元的产品
select prod_name,prod_price from products where prod_price between 5 and 10;
查找含空值的数据
select cust_name,cust_email from customers where cust_email is null;