sql satement for 2nd maximum value

Answers were Sorted based on User's Feedback



sql satement for 2nd maximum value ..

Answer / archana chavan

select top 1 * from author where phone < (select max(phone)
from author) order by phone desc

Is This Answer Correct ?    18 Yes 4 No

sql satement for 2nd maximum value ..

Answer / murli d

author is Table name
ID is column name

select top 1 * from author where ID < (select max(ID)
from author) order by ID desc

Is This Answer Correct ?    16 Yes 3 No

sql satement for 2nd maximum value ..

Answer / cherran

select top 1 sal from
( select top 2 sal from test order by sal desc ) as kk order
by sal

Is This Answer Correct ?    8 Yes 2 No

sql satement for 2nd maximum value ..

Answer / avnish

create table emp with row empsal having the datatype float
and insert some salary
now to get the second max salary
write the sql statement

select max(empsal) from emp where empsal<(select max(empsal)
from emp)
its asubquery

Is This Answer Correct ?    8 Yes 2 No

sql satement for 2nd maximum value ..

Answer / sonia

Rohan answer given by you was not working.....

Is This Answer Correct ?    6 Yes 3 No

sql satement for 2nd maximum value ..

Answer / sanjeev singla

Hey guys use this query ,i used it so many time ,it will be
useful to you..try this one...

SELECT MAX(Salary) AS Expr1
FROM Employees
WHERE (Salary <
(SELECT MAX(Salary)
FROM Employees))

Is This Answer Correct ?    3 Yes 1 No

sql satement for 2nd maximum value ..

Answer / ramavtar rajput

select Amount from T2 where Amount = ( select max(Amount)
from T2 where Amount < ( select max(Amount) from T2 ))

Is This Answer Correct ?    3 Yes 3 No

sql satement for 2nd maximum value ..

Answer / kaushal gajjar

select top 1 UnitsInStock
from products
where UnitsInStock in (select top 2 UnitsInStock from
products order by UnitsInStock desc)

Is This Answer Correct ?    4 Yes 4 No

sql satement for 2nd maximum value ..

Answer / suresh

department as table name,sfee as column name
SELECT TOP (1) sfee
FROM DEPARTMENT
WHERE (SFEE IN
(SELECT TOP (2) SFEE
FROM DEPARTMENT AS
DEPARTMENT_1
ORDER BY SFEE DESC))

Is This Answer Correct ?    1 Yes 1 No

sql satement for 2nd maximum value ..

Answer / jacob

1)Select Max(Total) from mark


2)select top 1 total from
( select top 2 total from mark order by total desc ) as
result order
by Total

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More VB.NET Interview Questions

What is the source code for display the picture in button click event?

0 Answers  


What are the advantages of an assembly?

0 Answers  


when do we need a multiple document interface?

2 Answers  


What is the feature anonymous type?

0 Answers  


how to save items in gridview and the form name is vendor rating?

1 Answers  






if user enters 1 or 2 or any other number in digit format in next textbox it should show the answer in word reading like if enters 12 answer should be twelve

4 Answers  


hello dear friends my problem is that i want to save images that is pictures in SQL server using vb.net can any body help me to do so please

1 Answers  


i had attended to infosys interview on 17th april 2010...on .net..3+ experience .. to my knowledge i did well in technical and they asked me to wait for next process ..so i waited for 15 min ..later one person came and said give 7-10 days time for intimation of next process do they keep technical and hr on different day ...or i loose the interview ..am confused yaar please any say na what accuatly would be happend

4 Answers   Infosys,


Which classes a dll can contain?

0 Answers  


What is the Advantage of vb.net over vb

0 Answers   Digital GlobalSoft,


What is difference between import system.data.sqlclient,system.data.oledb?

0 Answers  


Define cls?

0 Answers  


Categories