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 / bhagya
select * from emp as e1 where 1= (select count(*)from emp
as e2 where e1.sal<e2.sal)
| Is This Answer Correct ? | 9 Yes | 11 No |
Post New Answer View All Answers
What are Row versions of DataRow?
You want to use bids to deploy a report to a different server than the one you chose in the report wizard. How can you change the server url?
Describe in brief system database.
Is the primary key column of a table an index in ms sql server?
What is the impact on other user sessions when creating indexes?
what are defaults? : Sql server database administration
How to delete all rows with truncate table statement in ms sql server?
What is the standby server?
How except clause is differs from not in clause?
Which data types generate inaccurate results if used with an = or <> comparison in a where clause of a sql statement?
What do mean by xml datatype?
Which language is supported by sql server?
How to install sql server 2005 express edition?
What are sub reports and how to create them?
What is the query and subquery?