我想查询平均成绩大于60的学生ID和平均成绩
select StID,avg(Score)as AvgScore from niu_SC
group by StID
having avg(Score)>60
查询结果如上图, 有6位小数, 怎么只显示2位小数呢? 在SQL语句中怎么写?
Create table Testtable2
(ID int identity(1,1),
score float,
)
go
insert into Testtable2(score)
select 86.1
union all
select 75.1
union all
select 69.4
select avg(score) as avescore,cast(avg(score) as decimal(10,2)) as ExactAveScore from Testtable2