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 / elumalai.k
select top1 id,salary from employee
where
(salary<(select max (salary) As sal from employee As Empp))
orderby salary desc.
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
How to create new databases with "create database" statements?
Can foreign key be duplicate?
What is filter index?
You have several tables, and they are joined together for querying. The tables contain both clustered indexes and non clustered indexes to optimize performance, how should you distribute the tables and their indexes onto different file groups?
What are the limitations in ssrs on sql server express edition?
How to make a remote connection in a database?
I create a separate index on each column of a table. What are the advantages and disadvantages of this approach? : Sql server database administration
How do you trace the traffic hitting a sql server?
Explain what is “asynchronous” communication in sql server service broker?
What is Service Broker in sql server 2012?
Define magic tables in sql server?
How do you use a subquery to find records that exist in one table and do not exist in another?
Do you know what is similarity and difference between truncate and delete in sql?
What is sqlcmd?
What are types of storage modes? : sql server analysis services, ssas