単一の mysql クエリで、すべての列の値の合計の値を含む新しい行を合計として次のクエリに追加する必要があります。私を助けてください
SELECT username,enddt,SUM(zerotothirty) AS 0To30,
SUM(thirtytosixty) AS 31To60,SUM(sixtytoonetwenty) AS 61To120,
SUM(onetwentytotwoforty) AS 121To240,SUM(greaterthantwoforty) AS '>240'
FROM
(SELECT username,DATE(enddt) AS enddt,tickid,
IF(duration <=30, 1,0) zerotothirty,
IF(duration BETWEEN 31 AND 60, 1,0) thirtytosixty,
IF(duration BETWEEN 61 AND 120,1,0) sixtytoonetwenty,
IF(duration BETWEEN 121 AND 240,1,0) onetwentytotwoforty,
IF(duration >240,1,0) greaterthantwoforty
FROM report)AS r
GROUP BY username,DATE(enddt);