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 / sudip mondal
select top 1 from employee where ID in (select top2 ID from
employee order by Salary desc) order by Salary asc
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain syntax for disabling triggers?
What are the different types of join?
What do mean by xml datatype?
How to generate random numbers with the rand() function in ms sql server?
How do I find sql server instance name?
What is stored in the mssqlsystemresource database? : sql server database administration
If you want to send some data from access database to sql server database. What are different component of ssis will you use?
What is the beast way to write CTE in SQL Server ?
In my application I have a process which picks the scanned files (tif format) from a shared location and it links to application and shown on it.The actuall issue is that my process picks the file before it is completly written or scanned which results in displaying few parts of the image or incomplete image.I need to check if the file is not completly scanned or written then do not link it to application.Please help if any body tell me that how can i check that file is in written phase or locked through DTS.thanking you in advance
What is 1nf 2nf?
Is natural join and equi join same?
How to set a database state to offline in ms sql server?
Explain boyce and codd normal form(bcnf)?
Explain about system database?
What are indexes in ms sql server?