Select the Nth lowest value from a table?

Answer Posted / nishi

select level, min('col_name') from my_table where level = '&n' connect by prior

('col_name') <'col_name') group by level;

Example:

Given a table called emp with the following columns:

-- id number

-- name varchar2(20)

-- sal number

--

-- For the second lowest salary:

-- select level, min(sal) from emp

-- where level=2

-- connect by prior sal < sal

-- group by lev

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you tell me how to add new column in existing views?how?How is possible?

925


Please explain me all types of Data models. Also give me the details if each model can have other name.for example:schematic data model is also known as conceptual data model and entity relation data model.

1859


Design database draw er diagram for a certain scenario ?

4097


Is rowid unique in oracle?

518


How do I connect to oracle?

558






What is the usage of analyze command in oracle?

609


What are the set operators union, union all, minus & intersect meant to do?

557


What is redo log?

619


Why do I get unexpected characters from 8-bit character sets in weblogic jdriver for oracle?

604


What happens to the indexes if a table is recovered?

569


How can Oracle users be audited?

601


What is control file used for?

598


There are n numbers of flatfile of exactly same format are placed in a folder.Can we load these flatfile's data one by one to a single relational table by a single session??

1611


How do we create privileges in oracle?

580


Explain the blob datatype?

610