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

Answer Posted / kunal sain

select mark from student s
where 1=(select count(*) from student s1
where s1.mark<s.mark);

Is This Answer Correct ?    5 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to transfer an existing table from one schema to another schema in ms sql server?

698


Why is there a performance difference between two similar queries where one uses union and the other uses union all?

722


How to provide default values to stored procedure parameters?

751


What is the recommended total size of your memory optimized tables?

704


What is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting is possible?

677






What is store procedure? How do they work? When do you use?

690


Explain about integration services of Microsoft SQL server?

772


What are the three different part of rdl file explain them?

214


What is report rendering ?

131


What are key, name and value columns of an attribute? : sql server analysis services, ssas

764


What are the pre-defined functions in the sql server?

693


What are the recovery models for a database?

808


What is isolation levels?

752


What does ss stand for sexually?

794


What specific conditions database should meet, before you can bulk copy data into it using bcp?

735