1 // -----------------------------------------------------------------------
2 // Filename: minvalue.sql
3 // Purpose: Select the Nth lowest value from a table
5 // Author: Deepak Rai, SSE, Satyam Computer Services Ltd. India
6 // -----------------------------------------------------------------------
8 ## Comment with a hash symbol ##
9 select level, min('col_name') from my_table
11 connect by prior ('col_name') < 'col_name')
19 -- Given a table called emp with the following columns:
24 -- For the second lowest salary:
26 -- select level, min(sal) from emp
28 -- connect by prior sal < sal