see the Northwind sample database

解决方案 »

  1.   

    to jiangsheng(蒋晟.Net[MVP]) : 小弟刚开始学习.net,还不了解,能不能告诉直接查找的地址。谢谢。
      

  2.   

    select 部门=B.sectionname,
           用户名称=A.username
           1月合计=(select sum(eventnum) from 事件数据表 where sectionid=B.sectionid and  userid=A.userid and month(C.eventdate)=1),
           2月合计=(select sum(eventnum) from 事件数据表 where sectionid=B.sectionid and  userid=A.userid and month(C.eventdate)=2),
           ......
           12月合计=(select sum(eventnum) from 事件数据表 where sectionid=B.sectionid and  userid=A.userid and month(C.eventdate)=12),
           全年合计=(select sum(eventnum) from 事件数据表 where sectionid=B.sectionid and  userid=A.userid),
           排名=(select sum(1) from 事件数据表 where sectionid=B.sectionid and  userid=A.userid and  eventnum<=C.eventnum)
    from 用户数据表 A ,部门数据表 B, 事件数据表 C
    where A.userid=C.userid and B.sectionid=C.sectionid
    and year(C.eventdate)='某一年'
      

  3.   

    http://www.microsoft.com/downloads/details.aspx?FamilyID=06616212-0356-46A0-8DA2-EEBC53A68034&displaylang=en