I Have Employee table having column name as ID,SALARY
how to get second max salary from employee table with id
ex
ID SALARY
1 20000
7 37000
2 5000
Answer Posted / tusar
select distinct (a.sal),empno from emp a
where &N = (select count (distinct(b.sal))
from emp b where a.sal <= b.sal);
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What is built-in function?
What is a result set object returned by odbc_exec()?
Difference between Inner vs outer joins?
Explain the etl (extraction, transformation, and loading)?
What is sub-query in sql server? Explain its properties.
What are the tool windows in sql server management studio? : sql server management studio
List the different normalization forms?
How to use copy and concatenate commands in SQL?
What are a database and a data warehouse?
What is log cache in sql server?
What are different types of raid levels?
What programming language would you use to create embedded functions in ssrs?
How to list all schemas in a database?
What are sp_configure commands and set commands?
How to enable/disable indexes?