Customers
customer_id first_name last_name age country
1 John Doe 31 USA
3 David Robinson 22 UK
4 John Reinhardt 25 UK
5 Betty Doe 28 UAE
6 Robert doe 16 USA
7 Robert gdo 32 USA
SELECT *
FROM Customers
ORDER BY age
GROUP BY first_name
it groups Robert and John.It somehow reached this after the query.
customer_id first_name last_name age country
6 Robert doe 16 USA
3 David Robinson 22 UK
5 Betty Doe 28 UAE
1 John Doe 31 USA
why is it showing only one value per group.
the output should be that it sorts the value from within the group and write the groups as it is.but it writes the first entry of the group and sorting it according to that.can you explain why?
Ujjawal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1