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 / jyoti bikash panda

select a.marks from student a where(select count(b.marks)
from student b where a.marks<=b.marks)=2

Is This Answer Correct ?    2 Yes 2 No

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

Answer / dinesh gupta

4th highest salary

SELECT * FROM(
SELECT ROW_NUMBER() OVER (ORDER BY
grosssalary desc) AS salaryno , *
FROM (
select distinct grosssalary
from salarydetails where inmon='dec' and inyear = 2007
) as a
) As T
WHERE t.salaryno = 4

3rd lowest salary

SELECT * FROM(
SELECT ROW_NUMBER() OVER (ORDER BY
grosssalary ) AS salaryno , *
FROM (
select distinct grosssalary
from salarydetails where inmon='dec' and inyear = 2007
) as a
) As T
WHERE t.salaryno = 3

Is This Answer Correct ?    1 Yes 1 No

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

Answer / aaaa

SELECT * FROM `student` WHERE class='Six' ORDER BY mark DESC
LIMIT 1,1

Is This Answer Correct ?    1 Yes 1 No

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

Answer / vikas kant

select Top 1 marks from students where marks in(select Top
2 marks from students order by marks desc)

Is This Answer Correct ?    1 Yes 1 No

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

Answer / appalanaidu

select max(marks) from studentmaster where marks < (select max(marks) from studentmaster)

Is This Answer Correct ?    1 Yes 1 No

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

Answer / dolat ram

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

Is This Answer Correct ?    1 Yes 1 No

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

Answer / sarika

select max(mark)
from student
Having max(mark)<(select max(mark)
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 / maheswar reddy s

select top 1 * from (select top 2 marks from student order by marks desc)a order by marks

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

Get data to internal table from database table using select query.
Sort the second internal table by ascending order.
Then use Delete adjacent duplicates comparing highest marks.
It will remove duplicate highest marks.
Then sort the internal table by descending order.
Read internal table into workarea index 2.
It will give the second highest mark.

Some times we have to process more steps using all data's. At that time we have to create two internal table with same structure . Move the data from firs table to second table and do the above steps.

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

More SQL Server Interview Questions

What is reference section?

0 Answers  


What is the importance of a recovery model?

0 Answers  


What is the full form of ddl?

0 Answers  


explain different types of backups avaialabe in sql server? : Sql server database administration

0 Answers  


How to use group functions in the select clause in ms sql server?

0 Answers  


what are acid properties? : Sql server database administration

0 Answers  


How to create a simple user defined function in ms sql server?

0 Answers  


How many partitions a clustered index has by default in sql server 2012?

0 Answers  


How to connect sql server management studio express to sql server 2005 express?

0 Answers  


Can you force a query to use a specific index?

0 Answers  


What is the use of CASCADE CONSTRAINTS?

3 Answers  


When would you use the stored procedures or functions?

0 Answers  


Categories