Re: SQL TOP x
- From: Kent Milligan <kmill@xxxxxxxxxxxxxx>
- Date: Mon, 17 Jul 2006 07:27:39 -0500
Works for me - Which release are you on?
Bob Bergstrom wrote:
Below is the structure we would need and will not work on the iSeries...
Any ideas?
SELECT * FROM TABLEA a left outer join
(SELECT * from TABLEB
WHERE FIELD1 <> '3' and FIELD2 = 'D'
FETCH FIRST 1 ROW ONLY
) B
on a.FIELDA = b.FIELDA
and A.FIELDB = B.FIELDB
where FIELDC = 2 and FIELDD not in ('Z') order by FIELDC, FIELDB
On Tue, 15 Feb 2005 11:26:13 -0800, Elvis wrote:
select * from mytable
fetch first X rows only
optimize for X rows
--
Kent Milligan
ISV Enablement - System i
kmill@xxxxxxxxxxxxxxxx (spam trick) GO HAWKEYES!!
>>> ibm.com/iseries/db2
(opinions stated are not necessarily those of my employer)
.
- Prev by Date: Re: [DB2] Problem with select range records
- Next by Date: Re: Parsing XML from RPGLE
- Previous by thread: [DB2] Problem with select range records
- Next by thread: Re: SBMJOB End Status
- Index(es):