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

Answer Posted / naresh

select top 1 age from student where age<(select top 1 age
from student where age<(select distinct max(age) from
student ))

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to name query output columns in ms sql server?

538


How to list all stored procedures in the current database using ms sql server?

639


How you can move data or databases between servers and databases in sql server?

569


What is the tcp/ip port on which sql server runs?

570


How to create a user to access a database in ms sql server using "create user" statements?

526






How do I edit a stored procedure in sql server?

512


What is the difference between ‘having’ clause and a ‘where’ clause?

553


What is the use of group by clause?

531


What is the definition for sql server 2000?

595


What is report rendering ?

102


Where does the copy job runs in the log shipping primary or secondary? : sql server database administration

596


What is tablesample?

576


Explain having clause?

530


Can you type more than one query in the query editor screen at the same time?

576


Why should we go for stored procedures? Why not direct queries?

574