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

Answer Posted / lokeshwaran s

SELECT MAX(marks) AS second_highest_mark
FROM student
WHERE marks < (SELECT MAX(marks) FROM student);

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to assign null values to variables or columns?

557


Should you normalize audio?

535


How to Improve the performencs of SQL Server 2005 exclude stored Procedure and Indexes?

1588


How to delete all rows with truncate table statement in ms sql server?

500


Where do you find the default Index fill factor and how to change it?

609






Do you know what are pages and extents? : SQL Server Architecture

570


What is trigger and different types of Triggers?

580


How do you delete a data source?

566


When would you use the stored procedures or functions?

586


What are joins in sql and what are the different types of joins?

562


Is t sql the same as sql server?

524


Thanks to some maintenance being done, the sql server on a failover cluster needs to be brought down. How do you bring the sql server down?

533


which backup strategy you are following at ur company

1743


Explain try...catch with sql server?

606


What is table valued function and scalar valued functions?

497