Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



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

Answer / pravin more

select max(mark) from student where mark <
(select max(mark)from student)

Is This Answer Correct ?    53 Yes 14 No

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

Answer / madan

This ans. particularly when you want 2nd highest marks?
and not for nth highest marks.

SELECT MAX(mark) FROM student WHERE mark <
(SELECT MAX(mark)FROM student)

Is This Answer Correct ?    18 Yes 7 No

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

Answer / kumaravel

try using this...
select top 1 from student where marks in (select top 2 from
student order by marks desc)

Is This Answer Correct ?    16 Yes 10 No

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

Answer / sanjay

create table test(id int identity,marks int)
insert into test
select 20
union all
select 31
union all
select 33
union all
select 1
union all
select 3
union all
select 100
union all
select 88

select * from test


with data as
(
select marks,row_number() over(order by marks desc) as rno
from test
)
select * from data where rno = 3

Is This Answer Correct ?    4 Yes 0 No

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

Answer / supriya

select max(marks) from student where marks not in (select
max(marks) from student)

Is This Answer Correct ?    10 Yes 7 No

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

Answer / ravindra singh

select b.marks from (select distinct marks from student)
a,(select distinct marks from student) b
where a.marks >= b.marks
group by b.marks
having count(b.marks)=3

Is This Answer Correct ?    9 Yes 7 No

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

Answer / 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

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

Answer / rakesh

In Oracle

select marks from
(select marks from
(select marks from students order by marks desc)
where rownum<3
order by marks asc)
where rownum<2

Is This Answer Correct ?    3 Yes 1 No

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

Answer / suman

select max(mark) from student where mark <
(select max(mark)from student)

Is This Answer Correct ?    5 Yes 3 No

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

Answer / siva prakasam

SELECT TOP (1) stuMark
FROM Student
WHERE stuMark < (SELECT MAX(stuMark) FROM Student)
ORDER BY stuMark DESC

Is This Answer Correct ?    4 Yes 2 No

Post New Answer

More SQL Server Interview Questions

I hav 10 records only one column 1,2,3,4,5......10 now am writing query select max(column name) Then What is The Output

9 Answers   Brigade, Wipro,


What is postgresql server?

0 Answers  


Define self join in sql server joins?

0 Answers  


What are the different types of join?

0 Answers  


Do you know what are the properties of the relational tables?

0 Answers  


How are the unique and primary key constraints different?

0 Answers  


What happens when converting big values to integers?

0 Answers  


Write a SQL queries on Self Join and Inner Join.

0 Answers   Aspiring Minds,


How many types of local tables are there in sql server?

0 Answers  


Explain throw statement in sql server 2008?

0 Answers  


Define left outer join?

0 Answers  


hi, how to link a text file and a .rpt file in my tables of sql server and to retrieve those records for further use. reply me as soon as possible.

0 Answers  


Categories