CONNECT BY clause and LEVEL pseudocolumn are useful for queries against tables containing hierarchical data. An example is the EMP table, an employee has a manager which also can have a manager and so on.Code:select min(sal) from (select sal from (select sal from emp order by sal desc) where rownum <=2 )
Although the query you posted is usable, using CONNECT BY and LEVEL in this context is rather matter of interest.
I'd preferably use the query posted by me at least for the performance reason.
Ales




Reply With Quote