原帖由 ly5066113 于 2008-6-20 19:52 发表
写sql感觉会简单一些。
假设你的数据中的3个列为:
col1 col2 col3
20080525|0600|758836152.12
select
col1
sum(case when col2 = "0600" then col3 else 0 end)
sum(case w ...
欢迎光临 Chinaunix (http://bbs.chinaunix.net/) | Powered by Discuz! X3.2 |