Stack Overflow – Nested Group Function in Oracle

365 Days of Daily Coding – Day 170

Today, I have drifted off a bit from my usual SQL entries and decided to look at some of the questions asked in Stack Overflow. It also aligns with my wanting to view how other people approach questions that they face in their day-to-day work. At this point in time, to me what’s proven to be of significantly importance is to get the foundations right like how does this function/query behave or how to build efficient queries and so on.

The entry I look at is about how nested group function behave in Oracle. The question is basically about why a two aggregate function in this case, an AVG and MIN was not giving the correct result. It basically boiled down to the order of operations as pointed by in the second answer to the entry. There were some alternative answers using DENSE RANK or Subqueries which I liked.

Leave a comment