👁 0
Q: What is GROUP BY clause?
Answer:
GROUP BY aggregates rows. SELECT col, COUNT(*) FROM t GROUP BY col. All non-aggregate SELECT columns must be in GROUP BY. HAVING filters groups (vs WHERE filters rows). GROUP BY ROLLUP/CUBE for subtotals.