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

select studentid,student_name,marks from
(select row_number() over (partition by marks order by marks desc) as rnk,studentid,student_name,marks from student_marks)
where studentid in (1,4);

Is This Answer Correct ?    0 Yes 0 No

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

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

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

Answer / koti,khammam

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

Is This Answer Correct ?    1 Yes 2 No

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

Answer / poomanibe

with temptab as
(
select row_number() over(order by substring(marks,1,2)) as
rownum,* from Student
)
select * from temptab where rownum=1

Is This Answer Correct ?    0 Yes 1 No

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

Answer / dharmendra k. dixit

SELECT TOP 1 Marks (SELECT TOP 2 Marks from Tablename Order
by Marks Desc)From Tablename order by Marks Asc

Is This Answer Correct ?    0 Yes 2 No

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

Answer / rupa

Select max(Marks) from Marks where Marks <
(select max(Marks)from Marks)

Is This Answer Correct ?    0 Yes 2 No

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

Answer / sagesh

SELECT * FROM(
SELECT ROW_NUMBER() OVER (ORDER BY mark) AS Stu_Rank
FROM student) As T
WHERE Stu_Rank = 2

Is This Answer Correct ?    2 Yes 5 No

Post New Answer

More SQL Server Interview Questions

What is BCP? When does it used in sql server 2012?

0 Answers   TryTechnicals Pvt Ltd,


How to Insert multiple rows with a single insert statement?

0 Answers  


What are key constraints?

0 Answers  


Differentiate between ms sql server reporting services vs crystal reports?

0 Answers  


what is diffrent between store procedure and trigger

2 Answers  


select name of emplyoee whose total salary is 130 from following table. id name salary 1 a 100 2 b 20 3 c 50 1 a 30 2 b 70 Post the resulantant Query?

7 Answers  


What are the mathematical functions supported by sql server 2005?

0 Answers  


How to get number of days in a given year?

4 Answers   ADP,


Which trace flags are enabled in sql server?

0 Answers  


What happens when unicode strings concatenate with non-unicode strings?

0 Answers  


Explain the characteristics of a transaction server for example atomicity, consistency, isolation, durability?

0 Answers  


what is the Enterprise manager(2000) and management studio (2005)?

2 Answers  


Categories