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

How to create user defined functions with parameters?

1297


What are scheduled tasks in sql server?

1139


How does SSIS(Sql Server Integration Services) deffer from DTS(Data Transformation Services)?

1264


Why do we use functions?

956


How to get the definition of a user defined function back?

1086


Once setting replication, is it potential to own a publisher as sixty four bit sql server and distributor or subscribers as a thirty two bit sql server?

1062


What is database replication? What are the different types of replication you can set up in sql server?

1017


What does normalization do to data?

1140


Is candidate a key?

1002


what’s the difference between Covering Indexes and Clustered Indexes ? how to use clustered index small ?

2025


how to create a scrollable cursor with the scroll option? : Sql server database administration

1147


What is the use of nvl work?

1045


Determine when an index is appropriate?

1129


What is the difference between mysql and sql server?

1088


code to create procedure for taking databse backup in sql server or i have the query for it but what it's query returns means i want to show on my jsp that the databse backup has been taken on the basis of that return value.does it returns 0 or 1.wat is the code for that

2255