79260815

Date: 2024-12-07 14:59:43
Score: 2
Natty:
Report link

SELECT COALESCE(ID, 'TOTAL') AS ID, Product, SUM(Quantity) AS TotalQuantity FROM Sales GROUP BY ROLLUP(ID, Product);

Here, Replaces NULL in the ID column with "TOTAL" in rolled-up rows. Helps create more meaningful outputs by avoiding NULLs in summary rows.

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Sunil Nakka