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

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how many types of display are available on as/400 for user interaction?

640


which type of object is used in db2/400?

651


what opcode will be used to test the zone of a character field?

1095


WHAT IS AS/400 SYNORIO?

2890


what are different types of substems?

1347






Difference Between Call & Sbmjob?

778


when would you prefer logical file than opnqryf?

1379


what is the maximum number of fields under a record format of physical file?

1008


I need to insert a record in a file using STRSQL containing the some field values same as an already existing record in that file.I know to smple insert mentioning those values one by one.But is there any another query can be prepared for the same .Please share the query if known to you. Thanks in advance.

2266


what are the three line types in rlu ?

1485


what is the maximum number of subfiles that can specified in a display file ?

1054


what is message subfile?

1053


how do you know that records are locked?

1162


when do you explicitly open files and close files in an rpg program?

1193


what is the function of crtdupobj command?

1163