What is the query to find nth highest salary?
What is the use of cursors?

Answer Posted / ram

1. nth highest salary

-> select *from emp e where &n =(select count(distinct sal)
from emp m where e.sal <= m.sal);


2. -> Cursor.

When a query is executed in oracle, a result set is
produced and stored in the memory. Oracle allows the
programmer to access this result set in the memory through
cursors.

use a cursor?

Many times, when a query returns more than one row as a
result, we might want to go through each row and process
the data in different way for them. Cursor is handy here.

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the surrogate key?

644


Explain load alternative records / rows into multiple targets - informatica

689


Can we get 1st record through Informatica(without sequence number).

986


What are the issues you have faced in your project? How did you overcome those issues?

1914


What is substr in informatica?

663






What are the advantages of informatica?

573


What is meant by lookup transformation? Explain the types of lookup transformation?

569


can anyone explain me about retail domain project in informatica?

7437


Is there any target staging area in informatica not staging area

2126


What are the main issues while working with flat files as source and as targets ?

657


Suppose we have a source qualifier transformation that populates two target tables. How do you ensure tgt2 is loaded after tgt1?

630


Which transformation should we use to normalise the COBOL and relational sources?

748


What do think which one is the better joiner or look up?

731


What are the differences between joiner transformation and source qualifier transformation?

628


How do you manage the Parameter files while migrating your data from one environment to another environment?

553