Unique values and a short result
A delivery list need not repeat a city for every customer. Separate removing duplicate result rows from limiting how many rows appear, and choose an order before taking the first rows.
DISTINCT removes duplicates of the whole selected row; LIMIT caps the number of rows returned after sorting.
- DISTINCT
- Removes identical result rows using all selected columns together.
- LIMIT
- Caps result row count; it does not guarantee order or uniqueness.