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_at_sp15at20.hursley.ibm.com>
Date: Wed, 12 Jun 2002 22:57:53 +0100
Message-ID: <ae8gcf$h4c$1_at_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 - 23:57:53 CEST