How to retrieve a second highest salary from a table?
Note:Suppose salaries are in duplicate values
eg:
Name Sal
Malli 60000
Pandi 60000
Rudra 45000
Ravi 45000
Answer Posted / rajat
SELECT * FROM (
SELECT RANK()OVER( ORDER BY SALARY DESC) NUM, A.* FROM RAJ A)
WHERE NUM=2;
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
How do I save the results of sql query in a file?
What is lexical units in pl sql?
In a distributed database system, can we execute two queries simultaneously?
How does sql store data?
What is query syntax?
which operator is used in query for pattern matching? : Sql dba
Can a primary key be a foreign key?
How does sql*loader handles newline characters in a record? : aql loader
How do you know if a relationship is 2nf?
What is the usage of nvl function?
how many values can the set function of mysql take? : Sql dba
What is the difference between mdf and ndf files?
1. is it possible to use the cursor atttibutes (%found ,% rowcount , %isopen , %notfound ) to our user defined cursor names ....... cursor cursor_name is select * from scott.emp if you use... cursor_name%found , %rowcount ,%isopen,%notfound...will it work... -------------------------- 2.what is the difference between the varray and index by table .. -------- 3. type type_name is table of number(8,3) index by binary_integer; identifier_name type_name; first , last , prior , next ,trim are the methods we can use it for the above type...simillary is there any way to apply for cursors... with thanks and regards..sarao...
How can you create an empty table from an existing table?
How do I pipe the output of one isql to another?