易截截图软件、单文件、免安装、纯绿色、仅160KB

跪求sql语句

该sql语句用于统计2008年各月通过各种渠道收到简历的数量
SQL code:

select way_type_name,way_name,Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec from(
select w.way_id , w.way_name,w.way_type_id,
sum(case when month(send_date)=1 then 1 else 0 end) as Jan,
sum(case when month(send_date)=2 then 1 else 0 end) as Feb,
sum(case when month(send_date)=3 then 1 else 0 end) as Mar,
sum(case when month(send_date)=4 then 1 else 0 end) as Apr,
sum(case when month(send_date)=5 then 1 else 0 end) as May,
sum(case when month(send_date)=6 then 1 else 0 end) as Jun,
sum(case when month(send_date)=7 then 1 else 0 end) as Jul,
sum(case when month(send_date)=8 then 1 else 0 end) as Aug,
sum(case when month(send_date)=9 then 1 else 0 end) as Sep,
sum(case when month(send_date)=10 then 1 else 0 end) as Oct,
sum(case when month(send_date)=11 then 1 else 0 end) as Nov,
sum(case when month(send_date)=12 then 1 else 0 end) as Dec
from tb_resume r inner join tb_way w
on r.way_id = w.way_id
where year(send_date) = 2008
group by w.way_id, w.way_name,w.way_type_id
)as g inner join tb_way_type wt
on g.way_type_id = wt.way_type_id


查询结果:
way_type_name  way_name        Jan Feb Mar Apr May Jun Jul Aug Sep Oc


相关问答:

csv文件转换成sql导入到数据库,没有数据为何?

执行的顺序:
1)文件浏览框(选择文件使用)
选择好文件后
点击一个导入按钮的时候 ,把上面上传框里的csv文件以一个ID为文件名,上传到**/**文件夹下
2)读取这个文件夹下的csv的文件,转换成sql
3 ......

一个pl/sql问题 - Oracle / 开发

我是在toad中输入下段sql
  declare
  TYPE test_rec IS record(
  code varchar(10),
  name varchar(30)
  );
  v_book test_rec;
    ......

sql - MS-SQL Server / 疑难问题

sql的软件在哪里可以下啊!在网上找了蛮多都用不了啊

随便搞一D版吧,

迅雷第一个就可以用
2000,2005都这样

http://119.147.41.16/down?cid=0698C2D64D7D637D90A6D2482298E6717D4F15CD&t=2&fmt=-1 ......

MS SQL作业问题 - MS-SQL Server / 应用实例

如何在SQL2005中设定定时作业,比如说定时清理某些表的数据,
或者是定时的将某些表的数据导出excel!
在线等待,急急急,最好是详细步骤!
之前我做的作业有点问题!
帮UP

参考:http://hi.baidu.com/toiota ......

请问ASP如何连接多个SQL SERVER? - Web 开发 / ASP

有两个或以上的远程数据库,如何用ASP检测连接速度并连接最快的MSSQL数据库?

有这样的ASP函数吗?我GOOGLE了一下,找不到。

PHP+MYSQL下有这种例子:
PHP code:

Example:
$wgDBservers = array(
......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号