现在有table1它有字段职称,系别等,我要在table2中按系别统计所有职称的人数,总计人数等。
table2中字段是这样:
        系别,   总人数,    教授,    副教授.....
求一简单点的操作方法,谢了

解决方案 »

  1.   

    FYIhttp://community.csdn.net/Expert/FAQ/FAQ_Index.asp?id=170924
      

  2.   

    insert table2 select a.系别, from (select 系别,count(*) as f1 from table2 group by 
    系别)a,(select 系别,count(*) as f1 from table2 where 职称='教授'  group by 系别)b,
    (select 系别,count(*) as f1 from table2 where 职称='副教授'  group by 系别)c
    where a.系别=b.系别 and a.系别=c.系别
      

  3.   

    有个地方写错了
    insert table2 select a.系别,a.f1,b.f2,c.f3 from (select 系别,count(*) as f1 from table2 group by 
    系别)a,(select 系别,count(*) as f2 from table2 where 职称='教授'  group by 系别)b,
    (select 系别,count(*) as f3 from table2 where 职称='副教授'  group by 系别)c
    where a.系别=b.系别 and a.系别=c.系别
      

  4.   

    谢谢,我来试试看你们的方法,我以前自己写,只要我用into 它就提示into关键字错误,我用paradox表