आप GROUP BY
का उपयोग कर सकते हैं और WITH ROLLUP
, इस तरह:
SELECT
id
, SUM(jan) as jan
, SUM(feb) as feb
, SUM(mar) as mar
, SUM(jan+feb+mar) as TRS
FROM test
GROUP BY id WITH ROLLUP
आप GROUP BY
का उपयोग कर सकते हैं और WITH ROLLUP
, इस तरह:
SELECT
id
, SUM(jan) as jan
, SUM(feb) as feb
, SUM(mar) as mar
, SUM(jan+feb+mar) as TRS
FROM test
GROUP BY id WITH ROLLUP