You are viewing a single comment's thread. Return to all comments →
I understood the query but could not make as to why minimum function is used on the age ? Would be great if someone can explain this point ?
Not sure if I am correct, but he used min() with age just to trick the group by clause, because he need age in the result but not in the group by clause so safely putting it inside an agreegate function. (there is only one age for each code so min(age) won't affect the result) . Hope it helps !!
I do agree with you. Here min(age) is not needed. We could add age to group by and remove min(age) instead since there is one-on-one correspondence between age and code.