SELECT FIRST is not ANSI standard (nor is TOP). The standard, which DB2 supports just fine on the oldest machine I have (V5R1), is FETCH FIRST n ROWS, as in: SELECT utyp03, team03 FROM use03 WHERE envn03 = 'ECO' FETCH FIRST 1 ROWS ONLY I know this may seem a little uncouth grammatically when only fetching a single row, so you can also use the following: SELECT utyp03, team03 FROM use03 WHERE envn03 = 'ECO' FETCH FIRST ROW ONLY Joe
Unconfigured Ad Widget
Collapse
Announcement
Collapse
No announcement yet.
iSeries SQL
Collapse
X
-
iSeries SQL
Hi All Does anyone know if IBM have yet included the FIRST function in their SQL? I have v5r2 and it appears that it is not in this version. eg... SELECT utyp03, team03 FROM use03 WHERE envn03 = 'ECO' returns 3 records. however... SELECT first 1 utyp03, team03 FROM use03 WHERE envn03 = 'ECO' would return only the first record. TIA Kit
Comment
Comment