write the SQL statement to retrieve the 2nd Highest salary
ammount(File Name="EMPLOY",Field Name="SALARY")

Answers were Sorted based on User's Feedback



write the SQL statement to retrieve the 2nd Highest salary ammount(File Name="EMPLOY",Fi..

Answer / kamal

hi,
select max(salary) from empfile where salary <(select max
(salary from empfile))

or

select salary from empfile a 2=(select count(salary) from
from empfile b where b.salary>=a.salary)

Is This Answer Correct ?    24 Yes 2 No

write the SQL statement to retrieve the 2nd Highest salary ammount(File Name="EMPLOY",Fi..

Answer / yogesh

This is correct answer -Try it

SELECT SALARY FROM EMPLOYEE WHERE SALARY < (SELECT MAX
(SALARY) FROM EMPLOYEE) ORDER BY SALARY DESC FETCH FIRST 1
ROW ONLY

Is This Answer Correct ?    12 Yes 2 No

write the SQL statement to retrieve the 2nd Highest salary ammount(File Name="EMPLOY",Fi..

Answer / aravind.r

select min(SALARY) from EMPLOY where SALARY in
(select top 2 SALARY from EMPLOY order by SALARY desc)

Is This Answer Correct ?    7 Yes 5 No

write the SQL statement to retrieve the 2nd Highest salary ammount(File Name="EMPLOY",Fi..

Answer / sandeep

select top 1 salary from employee where salary<(select top 1 salary from employee order by salary desc) order by salary desc

Is This Answer Correct ?    2 Yes 1 No

write the SQL statement to retrieve the 2nd Highest salary ammount(File Name="EMPLOY",Fi..

Answer / vivek dwivedi

Select max(salary) from file where salary not in (select max(Salary) from file)

Is This Answer Correct ?    0 Yes 0 No

write the SQL statement to retrieve the 2nd Highest salary ammount(File Name="EMPLOY",Fi..

Answer / suresh miryala

select top 1 from (select top 2 from emp order by sal desc)A
order by sal

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More IBM AS400 AllOther Interview Questions

what is lokup opcode?

1 Answers   IBM,


Define the purpose of the following code (If you know, how would this be written in RPG ILE) HI LO EQ C *IN66 DOUEQ *OFF C KEY1 CHAIN FILEA 90 66 C 66 CALL PGM1 PRM C ENDDO

1 Answers  


what is the purpose of the indara keyword?

1 Answers   IBM,


what are dds required for subfile?

0 Answers   IBM,


We have seen no of parameter list but If we mention like this 'CALL PROGNAME PLIST ' how to know No of parameter name of program ?

2 Answers   IBM,






What controls which printer a report goes to?

4 Answers   Wipro,


i want to display the 10000 record in a subfile by using loadall , can we do it?

10 Answers   CybAge,


how to run other job when one job is active?

0 Answers   IBM,


How to create files dynamically without DDS?

1 Answers  


How many primary files allowed in a program?

1 Answers  


what are different types of substems?

1 Answers   IBM,


What is diff between EVAL & MOVE?

0 Answers  


Categories