Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: auto increment in select clause

Re: auto increment in select clause

From: Paul Vernon <paul.vernon_at_ukk.ibmm.comm>
Date: Wed, 12 Jun 2002 22:57:53 +0100
Message-ID: <ae8gcf$h4c$1@sp15at20.hursley.ibm.com>


In DB2 you can use

SELECT ROW_NUMBER() OVER(), ref FROM table

or

SELECT NEXVAL FOR sequence FROM table

the former is more flexable as you can PARTITION and/or ORDER your sequences

TTM suggests a TAG operator in RM VSS #1 which would work somewhat like ROW_NUMBER Regards
Paul Vernon
Business Intelligence, IBM Global Services Received on Wed Jun 12 2002 - 16:57:53 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US