发布网友 发布时间:2022-04-11 01:28
共3个回答
懂视网 时间:2022-04-11 05:50
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
热心网友 时间:2022-04-11 02:58
select * from 表名 WHERE (time BETWEEN 2007-06-07 ' AND '2007-06-10' )热心网友 时间:2022-04-11 04:16
select * from table where time > 2007-06-07 and time < 2007-06-10