我正在查询我的sql查询:
SELECT particulars.particularName as name, particulars.Date as date, SUM(particulars.Total) as Total
FROM particulars
WHERE particulars.Date BETWEEN '2017-04-01' AND '2017-04-30'
AND particulars.Branch_BranchId='1'
GROUP by particulars.particularName,particulars.Date
答案 0 :(得分:0)
您需要的是所谓的旋转。
看看这个例子(你可以在网上找到很多):
http://stratosprovatopoulos.com/web-development/mysql/pivot-a-table-in-mysql/