mysql查询当年1-12月数据。
select count(*) as jantradingvolume, coalesce(sum(tt.amount),0) as janamount,
(select count(*) from tt_trade tt
where date_format(tt.creationtime,'%y-%m') = concat(year(now()),'-02')) as febtradingvolume,
(select coalesce(sum(tt.amount),0) from tt_trade tt
where date_format(tt.creationtime,'%y-%m') = concat(year(now()),'-02')) as febamount,
(select count(*) from tt_trade tt
where date_format(tt.creationtime,'%y-%m') = concat(year(now()),'-03')) as martradingvolume,
(select coalesce(sum(tt.amount),0) from tt_trade tt
where date_format(tt.creationtime,'%y-%m') = concat(year(now()),'-03')) as maramount,
(select count(*) from tt_trade tt
where date_format(tt.creationtime,'%y-%m') = concat(year(now()),'-04')) as aprtradingvolume,
(sel