Hello,I'm trying to generate a query for the following table:ID NAME AGE1 John 242 Mark 203 John 304 James 15
My query has to group by Name column in order to get the lowest age for each name. SO I do that:SELECT NAME, MIN(AGE)FROM MyTableGROUP BY NAME
All correct. The problem is that I also want to have the Id of each row. My result should be:ID NAME AGE1 John 242 Mark 204 James 15
I know I could do that like this:SELECT A.*FROM myTABLE AJOIN ( SELECT NAME AS NAME, MIN(AGE) AS AGE FROM MyTable GROUP BY NAME) B ON A.NAME = B.NAME AND A.AGE = B.AGE
But In my case its not efficient beacause there are a lot of records.Is there any other way to get the Id of the result of MIN(AGE)???Thankyou very much!!!