时间:2021-07-01 10:21:17 帮助过:2人阅读
2、从Customers 表中查询Country字段内容以U开头的记录。
SELECT * FROM Customers
WHERE Country like "U%";
3、从Customers 表中查询Country字段为USA,并且City字段内容为Seattle或者以P开头的记录。
SELECT * FROM Customers
where Country ="USA" and (City ="Seattle" or city like "P%");
4、从Customers 表中查询City字段内容不重复的记录内容,仅仅返回City字段。(Distinct用来返回字段唯一不重复值的命令)
SELECT DISTINCT City FROM Customers;
5、Like 语句,S%,%S,%Sand%,分别表示S开头,S结尾,包含Sand
SELECT * FROM Customers
WHERE Country LIKE ‘%land%‘;
[IT学习]sql 入门及实例
标签: