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

Answer Posted / ahmed

SELECT TOP 1 student marks
FROM(
SELECT TOP 2 student marks
FROM students_table
ORDER BY student marks DESC) AS emp
ORDER BY student marks ASC;

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 the use of keyword with encryption.

783


While you are inserting values into a table with the insert into .. Values option, does the order of the columns in the insert statement have to be the same as the order of the columns in the table?

784


What are the advantages of user-defined functions over stored procedures in sql server?

667


What is a domain constraint give an example?

781


Some queries related to SQL

738






What is the simplest way to create a new database in ms sql server?

729


How many types of triggers in sql server?

711


Why use stored procedures in sql server?

710


What are the different kinds of ssrs reports?

192


What is the name of reporting services config file and what’s it’s used for?

119


What are the types of resultset?

710


You schedule a job to run every minute what will happen if the first job runs more than 1 min? Will the second instance of the job start?

795


What are system databases into sql server (2005/2008) : sql server database administration

760


Explain encryption of entire databases without the need for application changes in sql server 2008?

767


What happens if ntwdblib.dll is missing on your machine?

868