MySQL----按月统计数据
统计2010年 每月的资金
select DATE_FORMAT(date,'%Y-%m') as month,sum(money) as money from finance where DATE_FORMAT(date,'%Y')=2010 group by month order by month
select DATE_FORMAT(date,'%x年-第%v周') as week,sum(money) as money from finance_base where DATE_FORMAT(date,'%Y')=2010 group by week