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 command would you use to add a column to a table in sql server?

1307


What is user-defined function?

966


what is database replicaion? What are the different types of replication you can set up in sql server? : Sql server database administration

976


What is transaction server consistency?

1044


Where are full-text indexes stored?

987


What are examples of triggers?

1086


In what version of sql server were synonyms released?

939


What is the use of floor function in sql server?

1078


Where are SQL server users names and passwords are stored in sql server?

1262


Which is the best place or learning center for MS SQL?????In Bangladesh?????

2072


Do you know how to make remote connection in database?

962


What is the use of sql profiler in sql server 2012?

888


Can you please differentiate between a primary key and a unique key?

1005


Explain full-text indexing?

974


How to optimize stored procedure optimization?

890