select b.distinct院系,a.count班级 as 人数 from b ,a where b.班级=a.班级;

解决方案 »

  1.   

    select b.院系,count(1) 人数  
    from a,b where a.班级=b.班级 group by b.院系;
      

  2.   

    SELECT 院系,COUNT(学号)AS 人数 FROM A
    INNNER JOIN B ON A.班级=B.班级 GROUP BY 院系
      

  3.   

    同意bzszp(www.bzszp.533.net)的写法!
      

  4.   

    select 院系,count(学号) from a,b where a.班级=b.班级 group by 院系
      

  5.   

    select b.院系,count(a.学号) 人数  
    from a,b where a.班级=b.班级 group by b.院系;
      

  6.   

    select department,count(*) from aa,bb
    where aa.class=bb.class
    group by department
      

  7.   

    select b.院系,count(*) 人数  
    from a,b where a.班级=b.班级 group by b.院系;
      

  8.   

    select b.院系,count(1) 人数  
    from a,b where a.班级=b.班级 group by b.院系;