SELECt ProductID, SUM(IF(PaymentMethod = 'Cash', Amount, 0)) AS 'Cash', -- snip SUM(Amount) AS TotalFROM PaymentsWHERe SaleDate = '2012-02-10'GROUP BY ProductID
欢迎分享,转载请注明来源:内存溢出
SELECt ProductID, SUM(IF(PaymentMethod = 'Cash', Amount, 0)) AS 'Cash', -- snip SUM(Amount) AS TotalFROM PaymentsWHERe SaleDate = '2012-02-10'GROUP BY ProductID
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)