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

Answer Posted / adarsh pandey

select distinct mark from student_mark s
where (select count(distinct s1.mark) from student_mark s1
where s1.mark>=s.mark )=4;

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain different backup plans?

540


What is the importance of three tier architecture?

619


What is the minimum and maximum number of partitions required for a measure group? : sql server analysis services, ssas

609


It is important form e to get the information from log files of applications executed by the task scheduler? Does sql studio save these log files? : sql server management studio

565


what are candidate key, alternate key and composite key? : Sql server database administration

509






How can we delete a table in sql server?

565


what is a join and explain different types of joins? : Sql server database administration

548


Define inner join? Explain with an example?

520


What is user-defined scalar function?

571


How to drop existing indexes in ms sql server?

606


What are the basic functions for master, msdb, model, tempdb and resource databases?

564


What is report subscription?

95


What does it mean to normalize data?

525


Explain try...catch with sql server?

606


What can be used instead of trigger?

635