Hi all!
I want to get data from 2 different tables.
They have the following structure:
http://img337.imageshack.us/img337/2...tuctureqy8.jpg
or see attachement
The result i want to become is the following. I want all the lines in SROBTR that the same INREFX number as the first line in the SROKBA table (BTREFX).
So i did the following:
Code:
SELECT *
FROM SROBTR
WHERE INREFX = (SELECT BTREFX FROM SROKBA FETCH FIRST 1 ROWS ONLY);
Unfortunately, i receive the following error:
Code:
SQL STATE: 42601
Vendor Code: -199
Keyword FETCH not expected. Valid tokens: ) UNION EXCEPT. Cause.....: The keyword FETCH was not expected here. A syntax error was detected at keyword FETCH....
I am using DB2 v5.4
Does anyone have a solution for this? Or maybe another workaround to get the correct result?
Thanks in advance,
Andrew