Back to Developer Roadmap

Group By Without Aggregate

src/data/question-groups/sql-queries/content/group-by-without-aggregate.md

4.0296 B
Original Source

If you use the GROUP BY clause without an aggregate function, it is equivalent to using the DISTINCT command. For example, the command below:

sql
SELECT phoneNumber FROM phoneNumbers
GROUP BY phoneNumber

is equivalent to:

sql
SELECT DISTINCT phoneNumber FROM phoneNumbers