SELECT DATE_FORMAT(`INVOICE_DATE`, '%Y-%m') AS Month, SUM(TOTAL_COST), SUM(TOTAL_PROFIT), SUM(TOTAL_PROFIT) - SUM(TOTAL_COST) AS Profit FROM `invoice_table` WHERE DATE_FORMAT(`INVOICE_DATE`, '%Y') > 2000 GROUP BY DATE_FORMAT(`INVOICE_DATE`, '%Y-%m') ORDER BY Month ASC;Related Keywords: Developer, How-to, Solved, SQL Query
喜歡這篇文章嗎?
(暫時未有評分)
Loading...
(暫時未有評分)
Loading...