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 / ashish
hey u can try This It defenately work...It for The nth
position mean for the N th node try it out.......
SELECT *
FROM emp A
WHERE (n-1) = (
SELECT COUNT(DISTINCT(B.salary))
FROM emp B
WHERE B.salary > A.salary)
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
what is difference between NULL and ISNULL in SQL Server 2008?
How many types of local tables are there in sql server?
How can i Relate Tables in SSIS
What is the importance of three tier architecture?
Do you know what is similarity and difference between truncate and delete in sql?
What is Lock table in SQL?
What is a linked server in sql server?
List out what other servers you can use with ssrs?
What is subquery explain with example?
How many clustered indexes there can be on table ?
what is bit datatype and what's the information that can be stored inside a bit column? : Sql server database administration
How to get the number of affected rows?
Explain subquery and state its properties?
Which database stores information about replication?
What is normalization and what are the advantages of it?