发布网友 发布时间:2022-04-08 01:34
共6个回答
懂视网 时间:2022-04-08 05:56
这有两个语句,可是这两个语句的结果相同,但其他方面有什么区别呢?
1.select count(ts.tid),ts.tid from t_s ts ,
(select tid from teacher where age<45 group by tid) t
where ts.tid=t.tid
and
ts.sid in (select sid from student where age>12 group by sid)
group by ts.tid;
2.
select teacher.tid,total from teacher ,
(select t_s.tid,count(*) total from student,t_s where student.sid=t_s.sid and student.age>12 group by t_s.tid) as tea_stu2
where
teacher.tid=tea_stu2.tid
and teacher.age<45;
SQL求出小于45岁的各个老师所带的大于12岁的学生人数
标签:
热心网友 时间:2022-04-08 03:04
1 SELECT Student.Sno, SC.Cno热心网友 时间:2022-04-08 04:22
(1) select t.Sname,c.Cpno from热心网友 时间:2022-04-08 05:56
select A.Sno,A.Sname,B.Cname热心网友 时间:2022-04-08 07:48
select sno,sname,from student where (sage<18 and ssex='女')热心网友 时间:2022-04-08 09:56
100