J jackiehuang Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-23 #1 TABLE1:班级号 班级名 系别 TABLE2:学号 姓名 班级号 ………… 要通过系别查询相应的学生人数,SQL语句要怎么写? THX
Y yayiye Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-23 #2 select 系别,count(*) from (select A.系别,B.学号 from Table1 A,Table2 B where B.班级号=A.班级号) ) as C order by 系别 你试一下
select 系别,count(*) from (select A.系别,B.学号 from Table1 A,Table2 B where B.班级号=A.班级号) ) as C order by 系别 你试一下
J jackiehuang Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-23 #3 显示invalid use of keyword token: select line number 2 怎么改?
Q QuickSilver Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-23 #4 Select 系别,Count(系别) From (Select 系别 From TABLE1 AA,TABLE2 BB Where AA.班级号=BB.班级号) CC Group by 系别
D delphiland Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-23 #6 用不着子查询吧 SELECT A.系别,COUNT(B.学号) FROM A,B WHERE A.班级号=B.班级号 GROUP BY A.系别
X xuefeiyang Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-23 #9 SELECT A.系别,COUNT(B.学号) FROM A,B WHERE A.班级号=B.班级号 GROUP BY A.系别