I have student marks in a student table. I need second
highest mark .Then what will the query for this?
Answer Posted / dinesh gupta
4th highest salary
SELECT * FROM(
SELECT ROW_NUMBER() OVER (ORDER BY
grosssalary desc) AS salaryno , *
FROM (
select distinct grosssalary
from salarydetails where inmon='dec' and inyear = 2007
) as a
) As T
WHERE t.salaryno = 4
3rd lowest salary
SELECT * FROM(
SELECT ROW_NUMBER() OVER (ORDER BY
grosssalary ) AS salaryno , *
FROM (
select distinct grosssalary
from salarydetails where inmon='dec' and inyear = 2007
) as a
) As T
WHERE t.salaryno = 3
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
hi, how to link a text file and a .rpt file in my tables of sql server and to retrieve those records for further use. reply me as soon as possible.
Explain the steps to create and execute a user-defined function in the sql server?
Why should one not prefix user stored procedures with ‘sp_’?
What are different types of raid levels?
How to connect sql server management studio express to sql server 2005 express?
is there a column to which a default can't be bound? : Sql server database administration
What is difference between unique and primary key?
What are .mdf files?
What are the indexes in sql server?
What function does a database engine serve in the sql server?
How to create a new login name in ms sql server?
How to make a column nullable?
What is the use of @@spid?
How to create indexed view?
What are the differences between substr and charindex in sql server.