Fish Touching🐟🎣

SQL GROUP BY

Jun 5, 2023

# GROUP BY

Used in collaboration with aggregate functions like COUNT(), SUM(), AVG(), MAX(), or MIN(). It arranges the result set into groups based on the values of specified columns.

If you’re going to do any grouping / aggregation at all, then you must only SELECT grouped / aggregated columns.

# HAVING

Like WHERE but for GROUP BY