--union
--联合查询:用来把两个select查询结果集合并成一个结果集
--1.union查询,多个查询的列,个数必须相同
--2.nuion查询,多个查询的列,各个列的数据类型必须一一对应
--3.union会自动剔除完全重复记录,如果需要保留重复记录,应该使用union all
select Max(stuEnglish) as 最高分,
min(stuEnglish) as 最低分,
avg(stuEnglish) as 平均分
from Tbstudent
select '最高分' as 类别,MAX(stuEnglish) as 分数 from Tbstudent
union all
select '最低分' as 类别,MIN(stuEnglish) as 分数 from Tbstudent
union all
select '平均分' as 类别,AVG(stuEnglish) as 分数 from Tbstudent