I have student marks in a student table. I need second
highest mark .Then what will the query for this?

Answer Posted / jyoti bikash panda

select a.marks from student a where(select count(b.marks)
from student b where a.marks<=b.marks)=2

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Name 3 ways to get an accurate count of the number of records in a table?

673


Explain temporary table vs table variable by using cursor alternative?

611


What happens to a statement batch if there is a compilation error?

596


You want to generate a report that is formatted as a chart. Can you use the report wizard to create such a report?

92


How do I connect to sql server database?

577






You are creating an application where users are asked their gender in the gender combo box you have three options: ‘male’ , ‘female’ and ‘i choose not to disclose’ these options are stored in the table as 1, 0 or null which datatype should you use?

630


Can you index views?

582


List the different normalization forms?

622


Comment,Datatypes are unlimited

1722


How to generate create table script on an existing table in ms sql server?

743


What is an expensive query?

623


How much space does sql server 2016 take?

651


System variable and temporary variables

1807


What is default constraint in ms sql server?

620


Why transaction is important?

637