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 / belson gnana pradeep
Select Top 1 salary from (Select TOP 2 salary from tbl_salary order by salary desc)a order by salary
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is 1nf 2nf?
What is surrogate key? : sql server analysis services, ssas
When would you prefer to have a minimum number of indexes?
What is the difference between a local and a global temporary table?
Can we store videos inside the sql server table?
How many servers can we create in a single subscription?
What is set nocount on and what is set nocount off?
How do I start and stop sql server?
What is the difference between value type and reference type?
What is the use of toad or sqldbx.?
After creating the cube, if we added a new column to the oltp table then how you add this new attribute to the cube? : sql server analysis services, ssas
I have all the primary data files, secondary data files as well as logs. Now, tell me can I still restore the database without having a full backup? : sql server database administration
I applied Transactional with updatable subscriptions replication on 2 tables now i want to delete those 2 tables but i cannot delete those tables as replication is running how can i stop replication for those 2 tables(but i don't want to delete those replicated tables but i need to stop the replication) how can i do that
List the advantages of using stored procedures?
How to list all triggers in the database with sys.triggers in ms sql server?