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 / vk

select studentid,student_name,marks from
(select row_number() over (partition by marks order by marks desc) as rnk,studentid,student_name,marks from student_marks)
where studentid in (1,4);

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are trace flags and mention a few common trace flags used with sql server?

1094


How to query multiple tables jointly?

997


What are the different ways you can create databases in sql server?

1112


What are the new features introduced in SQL Server 2000? What changed between the previous version of SQL Server and the current version?

2369


What is temporal data type?

925


Does a server store data?

930


What is the name of the Database which IBM mainframe uses?

989


What is the use of tempdb? What values does it hold?

1076


What is Command line parameters in PLSQL.?

1137


Describe the functionalities that views support.

1110


How do I install only the client tools of sql server 2000?

1073


What is check constraint in sql server?

1007


What is autocommit mode in sql server?

1189


How data can be copied from one table to another table?

956


Beginning with sql server version 7 0, a new enhanced data type nchar was added what type of data is supported with this data type?

1018