Reputation: 213
I have wrote query like:
select name,age from people group by name order by age DESC ;
I want to select max age for same names .but it gives "ORA-00979: not a GROUP BY expression".
Help me please.
Thanks.
Upvotes: 2
Views: 176
Reputation: 1169
Try
SELECT name, MAX(age) A FROM poeple GROUP BY name ORDER BY A DESC
Upvotes: 3