select the 3rd maximum salary from sql server database if 4
(just an example In practically I may not know the exact
situation) of the highest salaries are equal.
Answer Posted / sumesh.s.g
--Sumesh.S.G--
SELECT TOP 1 salary
FROM (select top 3 Salary
from dbo.TBL_Employee
order by Salary desc) as TemTable order by Salary asc
--Happy coding--
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
your distribution database is full what will u do
Explain having clause?
How to provide default values to stored procedure parameters?
How to provide values to stored procedure parameters in ms sql server?
What is the difference between char and varchar2 datatype in sql?
How do I find query history in sql server?
How to transfer an existing table from one schema to another schema in ms sql server?
Explain the difference between functions and stored procedures in sql server?
What is ms sql server service broker?
What is the difference between grant and with grant while giving permissions to the user?
Does server sql treat char as a variable-length or fixed-length column?
How to create a new login name in ms sql server?
Explain collation?
sql database suspect We have a sql database that is showing as suspect. How can we recover?
Thanks to some maintenance being done, the sql server on a failover cluster needs to be brought down. How do you bring the sql server down?