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

does cl support arrays

1 Answers  


we have 2 PF files with same name, how to copy data's from one file to another through RPG program logic?

3 Answers  


I am fresher 2009 passedout.can you pls explain me what is AS400 and where it can be used and how about growth in the position as well as salary, whether it is a programming language or else?

3 Answers  


1.what operation cannot be used in conjunction with file coded as divice type disk? 2.Difference between INCLUDE AND COPY?

1 Answers  


I have a display file with mandatory fields. Is there anyway that i can highlight those fields to bring attention to the user? The same behavior that AS400 makes when we attempt to execute a command without completing all the required parameters. Note: I have used DSPATR(HI) or DPSATR(RI) and they have different behaviors. Thanks.

2 Answers  






What is the purpose of SFLFOLD and SFLDROP keywords?

1 Answers  


what is the purpose of putovr (put with explicit override) keyword?

1 Answers   IBM,


what is a program described file in rpg?

1 Answers   IBM,


What is a Device file?

1 Answers  


What is library is as400? What are the types of library?

1 Answers  


What is an authorization list?

1 Answers  


How can I automate sftp commands(ls & get) in CL program.. If I want to write two scripts one for each command... can u plz tell where the script should be written? & what will be the content of each scripts?

1 Answers  


Categories