SELECT COUNT(a.price),a.price ,SUM(a.price)
FROM chronicle.GAIA_MST_PURCHASE_ITEM_DATA a
LEFT JOIN chronicle.GAIA_PURCHASE_IOS_HISTORY b on b.purchase_item_data_id=a.purchase_item_data_id
WHERE
b.created_time like '2014-05-28%' and
a.os_type_id=1 GROUP BY a.price with rollup;
先分组 求和(行值)
在对列值求和
13 6.000 78.000
161 30.000 4830.000
15 68.000 1020.000
17 98.000 1666.000
49 198.000 9702.000
10 308.000 3080.000
7 548.000 3836.000
14 998.000 13972.000
286 38184.000
阅读(1365) | 评论(0) | 转发(0) |