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

How to Insert multiple rows with a single insert statement?

744


What is difference between drop truncate and delete?

732


Define outer join in sql server joins?

677


What is the synonym of join?

684


Why do we use sql limitations? Which constraints can we use while making a database in sql?

740






List the ways in which dynamic sql can be executed?

792


How do I get Report Builder to generate a parameter that can be set by users viewing the report?

124


What is meant by referential integrity?

748


What is the full form of ddl?

664


How to generate create procedure script on an existing stored procedure?

694


What is merge replication?

858


What are tables in sql server?

699


Can we insert data if clustered index is disabled?

675


Does sql server use java?

725


What are logical/boolean operations in ms sql server?

718