一点sql语句的疑问
selectstudent.S#,student.sname,cast(avg(score)asdecimal(18,2))avg_scorefromstudent,sc...
select student.S# , student.sname , cast(avg(score) as decimal(18,2)) avg_score from student , sc
where student.S# = SC.S# and student.S# in (select S# from SC where score < 60 group by S# having count(1) >= 2)
group by student.S# , student.sname
大家帮忙看下,having count(1) >= 2 里面的count(1)是什么意思?看到过好多次了,不是很理解,详细说明的我再加分
不是问那个意思,是count(1)里面的1是代表第一个字段?还是什么?
好像count()括号里面可以是任意数字,为什么可以这样写 展开
where student.S# = SC.S# and student.S# in (select S# from SC where score < 60 group by S# having count(1) >= 2)
group by student.S# , student.sname
大家帮忙看下,having count(1) >= 2 里面的count(1)是什么意思?看到过好多次了,不是很理解,详细说明的我再加分
不是问那个意思,是count(1)里面的1是代表第一个字段?还是什么?
好像count()括号里面可以是任意数字,为什么可以这样写 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询