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 many functions are there in sql?
Does mysql_real_escape_string prevent sql injection?
How to avoid using cursors?
Is sql scripting language?
Can we group by two columns in sql?
What are sql queries used for?
how to convert numeric values to character strings? : Sql dba
What is a recursive stored procedure?
What is the use of sql trace?
How do you go back in sql?
What does stand for in sql?
What is a procedure in pl sql?
how is exception handling handled in mysql? : Sql dba
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...
What are all different types of collation sensitivity?