基础查询
查询语法
select 字段列表
from 表名列表
where 条件列表
group by 分组字段
having 分组后条件
order by 排序字段
limit 分页限定
1、查询多个字段
select 字段列表 from 表名;
select * from 表名;-- 查询所有数据
2、去除重复记录
select distinct 字段列表 from 表名;
3、起别名
as:as也可以省略
基础查询
查询name,age两列
select name,age from stu;
查询所有列
select * from stu;
查询地址信息
select address from stu;
去除重复信息
select distinct address from stu;
-- 查询姓名,数学成绩,英语成绩(起别名 select name,math as 数学成绩,english as 英语成绩 from stu;