iSeries SQL (1 viewing) (1) Guest
Favoured: 0
|
|
|
TOPIC: iSeries SQL
|
J.Pluta (User)
Platinum Boarder
Posts: 2712
|
|
iSeries SQL 1 Year, 10 Months ago
|
Karma: 0
|
|
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: <p>SELECT utyp03, team03 FROM use03 WHERE envn03 = 'ECO' FETCH FIRST 1 ROWS ONLY <p>I know this may seem a little uncouth grammatically when only fetching a single row, so you can also use the following: <p>SELECT utyp03, team03 FROM use03 WHERE envn03 = 'ECO' FETCH FIRST ROW ONLY <p>Joe
|
|
|
|
|
|
|
The administrator has disabled public write access.
|
kitvb1 (User)
Fresh Boarder
Posts: 15
|
|
iSeries SQL 1 Year, 10 Months ago
|
Karma: 0
|
|
Hi Joe, <BR>
Thanks... it works... <p>Regards <p>Kit
|
|
|
|
|
|
|
The administrator has disabled public write access.
|
mscottx (User)
Fresh Boarder
Posts: 18
|
|
iSeries SQL 1 Year, 9 Months ago
|
Karma: 0
|
|
|
|
|
|
|
|
|
The administrator has disabled public write access.
|
kitvb1 (User)
Fresh Boarder
Posts: 15
|
|
iSeries SQL 1 Year, 9 Months ago
|
Karma: 0
|
|
Hi All <BR>
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. <BR>
eg... SELECT utyp03, team03 FROM use03 WHERE envn03 = 'ECO' returns 3 records. <BR>
however... SELECT first 1 utyp03, team03 FROM use03 WHERE envn03 = 'ECO' <BR>
would return only the first record. <p>TIA <BR>
Kit
|
|
|
|
|
|
|
The administrator has disabled public write access.
|
|
|
|
|