求条统计次数的SQL语句,结果如图!
[img=http://hi.csdn.net/space-5218613-do-album-picid-762690.html][/img] --------------------编程问答-------------------- [img=http://hi.csdn.net/space-5218613-do-album-picid-762690-goto-down.html][/img] --------------------编程问答-------------------- 杯具。。。无图。。 --------------------编程问答-------------------- --------------------编程问答-------------------- 表结构都没 怎么统计 --------------------编程问答-------------------- 就是一个报表 --------------------编程问答-------------------- 横向合计:select sum(monthtime) from table纵向合计:select sum(monthtime) from table group by month --------------------编程问答-------------------- 查询出来的结果 跟图一样 SQL语句怎么写 才行 --------------------编程问答-------------------- select 车辆编号,count(n) as 次数 from
(select 1月 as n from table1
union all
select 2月 as n from table1
union all
select 3月 as n from table1
union all
--...
select 12月 as n from table1
) group by 车辆编号
或者行列转换后Sum()
--------------------编程问答-------------------- 表结构 --------------------编程问答--------------------
select 车辆编号, count(次数) where dateField between '2012-12-11' and '2012-12-12' grounp by 车辆编号
去查查Grounp by的用法就知道了
补充:.NET技术 , C#