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 is a default tcp/ip socket assigned for sql server? : Sql server database administration

1002


Do you know clustered and non-clustered index?

930


Does the order of columns in update statements matter?

858


how many type of indexing in database?

935


Can we use trigger new in before insert?

865


What are the differences between DDL, DML and DCL in SQL?

1169


Explain the ways to controlling cursor behavior?

872


What is cursors?

1094


Can you tell me some of the common replication dmv's and their use? : sql server replication

870


How to declare a cursor with "declare ... Cursor" in ms sql server?

978


What is 3nf normalization form?

1023


Does full backup break log chain?

911


What is the difference between functions and scalar functions?

1124


What happens if date-only values are provided as date and time literals?

976


Data is not being delivered to subscribers, what can be the possible reasons? : sql server replication

980