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
What is buffer cash in sql server?
How do I find the sql server version?
how do you test proper tcp/ip configuration windows machine? : Sql server database administration
Difference between Logical Page and Physical Page in SSRS.
Mention what are the different types of ssrs reports?
What is the function of inner join?
What is log shipping? Can we do logshipping with SQL Server 7.0 - Logshipping is a new feature of SQL Server 2000. We should have two SQL Server - Enterprise Editions. From Enterprise Manager we can configure the logshipping. In logshipping the transactional log file from one server is automatically updated into the backup database on the other server. If one server fails, the other server will have the same db and we can use this as the DR (disaster recovery) plan.
How can we use ConnectorJ JDBC Driver with MS SQL?
How to get a list of columns using the "sys.columns" view in ms sql server?
What is for xml in sql server?
What are differences in between sql server 2012 and sql server 2016?
How is table type constraint applied to a table?
what is the difference between Delete and Truncate command in SQL
What do you understand by replication in sql server?
What is star, snowflake and star flake schema? : sql server analysis services, ssas