Originally posted by varshanswamy
Hi hrishy

Can u explain the logic for the query esp the inner query.

bye.
Aparajita.

Hi Aparajita

The inner query is called co-releated sql query in Relation Database Terminology.A co-releated sql query executes once for the row returned by the main query.Look up the documentation or search google for co-releated subquery.

A ordinary subquery on the other hand is run once only

Hope the explanation was useful.

In 8.0.5 since analytical functions are not avaliable the above query is the way to go.

regards
Hrishy