时间:2021-07-01 10:21:17 帮助过:27人阅读
2.聚合函数
Avg() Count() Sum() Min()/Max()
Select max(score1),min(score1)from talScroe
“架构”信息,后面详细了解
3.Top截取 和 Order排序
Select * from talScore order by scoreId asc/desc,score2 asc/desc (升序和降序)
Select
top 3 *,
StuId as Demo,
from
talScore
order by
score1 desc
4.去除重复:Distinct
select * from tabScroe
select distinct score1 from talScroe order by score1
select distinct title,MiddleName from [SalesLT].[Customer] order by Title,MiddleName ——title,MiddleName联合起来去重
distinct 只能紧跟这select 后面,而且是对后面的所有的列都进行去重复操作
2_01_MSSQL课程_查询01
标签:去重 dem 课程 mssql top sel avg rom from