Subject FIRST/SKIP in a Subquery
Author jrodenhi
This question duplicates one I sent to the Atkins server because my
posting there was not immediately approved and I don't know that it
will be. Any help offered on this issue would be much appreciated.

If I run this query against the example Employee database:

SELECT FIRST 5 Emp_No
FROM Employee
ORDER BY Last_Name

I get, as I would expect, 5 records in my result set. But, if make
this query a subquery as in this:

SELECT Emp_No, New_Salary
FROM Salary_History
WHERE Emp_No IN (
SELECT FIRST 5 Emp_No
FROM Employee
ORDER BY Last_Name
)
I get a gazillion records back. Is this a bug. How would I get the
Salary_History back just for those first 5 employees?

Also, if I modify the first line of the subquery to read:
SELECT FIRST 5 SKIP 5 Emp_No
I get nothing back at all. This is not helpful. Do I have my syntax
wrong? Thanks for your help.

Jack Rodenhi