1. 查询选项
select [查询选项] 字段名称 from 表名;
all: 显示所有查询出来的数据[默认]
distinct: 去除结果集中重复的数据之后再显示
select name from stu;
select all name from stu;
select distinct name from stu;
注意点:
如果是通过distinct来对结果集中重复的数据进行去重
那么只有所有列的数据都相同才会去重
select name, score from stu;
select distinct name, score from stu;
完整的查询语句
select [查询选项] 字段名称 [from 表名] [where 条件] [order by 排序] [group by 分组] [having 条件] [limit 分页];