Re: Counter

From: gazzag <gareth_at_jamms.org>
Date: Wed, 6 Feb 2008 07:20:57 -0800 (PST)
Message-ID: <cb473dcc-e0f8-4b23-ba7e-965f322a073b@d21g2000prf.googlegroups.com>


On 6 Feb, 15:04, "ame..._at_iwc.net" <ame..._at_iwc.net> wrote:
> Hi All,
>
> I'm looking around right now to see if this is possible, but I thought
> I'd ask here too.
>
> Can you have a record counter in an insert statement?  Something like
> this:
>
> INSERT INTO table_a (
>    SELECT flda, fldb, fldc, i++, fldd FROM tableb);
>
> Basically there is one column that is a record counter.  And since
> this is not a loop, I'm not sure how it is done.  Maybe a sub-select
> with a count(*)??
>
> Thanks a bunch!

Look into Oracle sequences:

http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/schema.htm#sthref883

HTH -g Received on Wed Feb 06 2008 - 09:20:57 CST

Original text of this message