Question · SQL and MySQL course · Module 2: Querying data (SELECT)
DISTINCT with multiple columns
What does DISTINCT remove when you give several columns, e.g. "SELECT DISTINCT imie, nazwisko FROM czytelnicy;"?
Answer options
- Only repeated first names, ignoring surnames
- Repeated combinations of values - a row disappears when first name and surname together are the same
- All rows, leaving just one
- Nothing - DISTINCT works only with a single column
Show the answer
Correct answer:
- Repeated combinations of values - a row disappears when first name and surname together are the same