Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

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.

2024


Explain the steps to create and execute a user-defined function in the sql server?

917


Why should one not prefix user stored procedures with ‘sp_’?

984


What are different types of raid levels?

1068


How to connect sql server management studio express to sql server 2005 express?

963


is there a column to which a default can't be bound? : Sql server database administration

966


What is difference between unique and primary key?

853


What are .mdf files?

885


What are the indexes in sql server?

1021


What function does a database engine serve in the sql server?

984


How to create a new login name in ms sql server?

992


How to make a column nullable?

1033


What is the use of @@spid?

955


How to create indexed view?

985


What are the differences between substr and charindex in sql server.

1012