獲取mysql 數(shù)據(jù),java從mysql取出數(shù)據(jù)后按日期相同的月份累加?
用sql語句處理更為合理:
假設(shè)時(shí)間字段為bw_date, 則sql語句如下:
select sum(BW_VALUE), sum(PRICE) from table group by month(bw_date);
用sql語句處理更為合理:
假設(shè)時(shí)間字段為bw_date, 則sql語句如下:
select sum(BW_VALUE), sum(PRICE) from table group by month(bw_date);