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
Can you change the data type of a column in a table after the table has been created? If so, which command would you use?
Tell me the phases a transaction has to undergo?
how would you store your query in an SSRS report or a Database server?
How do you start single user mode in clustered installations?
How to modify the underlying query of an existing view?
What is ems sql management studio? : sql server management studio
how do you determine the Load performance of any query in sql server {example how do u determine performance of a select stmnt which returns Dynamically many no of records ... some times 100,1000,10000 etc., }
What is single-user mode and what are the steps you should follow to start sql server in single-user mode?
What is Replication?
What is a collation?
Explain the etl (extraction, transformation, and loading)?
What is a natural primary key?
What is faster join or union?
How to include date and time values in sql statements?
Explain triggers?