Do the keyword "DISTINCT" works only for the immediate next column_name to it or for all column-names in a query? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Do the keyword "DISTINCT" works only for the immediate next column_name to it or for all column-names in a query?

SELECT DISTINCT name, age FROM people; will this query return records with unique 'name' values only or only those records with unique 'name' and unique 'age' values?

14th Jan 2017, 3:22 AM
Sourabh Deoghare
Sourabh Deoghare - avatar
1 Answer
+ 4
Only the next column. Write separately for every column.
14th Jan 2017, 4:00 AM
Divesh Agarwal
Divesh Agarwal - avatar