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
How can we call UDF(User Define Function) using C# code in ASP.net ?
What is the difference between online clustering and Offline clustering?
Tell me about the approaches which you used to counter the DI problems.
What is the difference between dbcc indexdefrag and dbcc reindex?
What are the system database in sql server 2008?
What are the restrictions that views have to follow? : SQL Server Architecture
What are pages and extents? : SQL Server Architecture
What is difference between views and stored procedures?
What is query cost in sql server?
What is pivot and unpivot?
What are the differences between local and global temporary tables?
What is store procedure? When do you use?
What language is sql server written in?
Explain the steps to use transact-sql cursor?
How to connect to a sql server using odbc_connect()?