查询语句汇总

查询语句汇总

查询课程C1的最高分和最低分以及最高分和最低分之间的差距

    select max(grade),min(grade),max(grade)-min(grade) from 

查询其他系比计算机系CS所有学生年龄都要小的学生的姓名及年龄

方法一:

    select sname,age from s where age'cs'

方法二:

    select sname,age from s where age<(select min(age)from s where sd='cs') and sd<>'cs'

group by

    select sno,avg(grade) from sc group by sno

having

    select t.reason from sa.t_workform_unfinish_reason t group by t.reason having count(t.create_user_id)>1

你可能感兴趣的:(sql,查询语句)