You can also create all your tables with an identity column, then use that
column:
ROWNUM DECIMAL(15, 0) NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1,
INCREMENT BY 1, CACHE 20, MINVALUE 1, MAXVALUE 999999999999999, NO CYCLE, NO
ORDER)
-----Original Message-----
From: GrJohnson
[mailto:db2udbdba-ezmlmshield-x13146427.[Email address protected]
Sent: Monday, June 14, 2004 10:39 AM
To: LazyDBA Discussion
Subject: Re: Something similar to ROWNUM in Oracle
You can use fetch first XX rows only.
select * from employee fetch first 5 rows only
Greg S. Johnson
Oracle/DB2 Database Administrator
Tomax Corporation
801-924-6297
"amit b " <db2udbdba-ezmlmshield-x39278066.[Email address protected]
06/14/2004 08:24 AM
To: "LazyDBA Discussion" <[Email address protected]
cc:
Subject: Something similar to ROWNUM in Oracle
Hi,
Can anyone tell me is there any syntax in DB2 similar to rownum in oracle.
Say in oracle i can give select * from employee where rownum > 5 or delete
from emp where rownum >6;
is there something similar to that in DB2.
Thanks,
Amit
---------------------------------------------------------------------
PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
website: http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
For additional commands, e-mail: db2udbdba-[Email address protected]
---------------------------------------------------------------------
PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
website: http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
For additional commands, e-mail: db2udbdba-[Email address protected]
*************************************************************
This message, including any attachments, may contain
confidential information intended for a specific individual
and purpose, and may be protected by law. If you are not
the intended recipient, please notify the sender by e-mail
or telephone immediately, and then immediately delete this
message. Any disclosure, copying or distribution of this
message, or the taking of any action based on it, by any
unintended recipient is strictly prohibited.
DB2 & UDB email list listserv db2-l LazyDBA home page