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
What is the usage of analyze command in oracle?
Provide an example of a shell script which logs into SQLPLUS as SYS, determines the current date, changes the date format to include minutes & seconds, issues a drop table command, displays the date again, and finally exits.
How to view all columns in an existing table?
what is port in oracle? how is it related to database application.
How to pass a cursor variable to a procedure?
Explain the difference between sap and oracle?
How to connect the oracle server as sysdba?
What the is the diff between local index and global index. give some example.
How does the on-delete-cascade statement work?
Explain how you would restore a database using RMAN to Point in Time?
Why is oracle database so popular?
How to connect to the server with user account: sys?
Is insert autocommit in oracle?
Explain coalesce function?
src name sex a,male b,female c,male d,female Required output : male female a,b c,d tried pivot but was not successfull select * from src pivot (max(name) for sex in ('MALE','FEMALE'));