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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Seqence Number Automation?

Re: Seqence Number Automation?

From: Brent Douglas <Brent.Douglas_at_DAYTONOH.NCR.COM>
Date: Tue, 24 Aug 1999 11:20:08 -0400
Message-ID: <37c2b88a@rpc1285.daytonoh.ncr.com>


i think you can accomplish this, something like:

insert into summarytable (sumnum,num) values (select sum(col),number

       from table
       group by number);

if you set up the summarytable to have a default value on the column you want to autonumber... at worst, set a trigger to use nextval? you don't need to show it in your insert stmt, fill it 'behind the scenes' w/ the default or trigger (on insert) )

hth,
brent

>Hi I'm trying to generate a summary table with a new field sum_id which
>should be generated whenever there's a new record. I thought of using
>sequence number but I found it can't be used with GROUP BY clause like
this:
> select my_seq.NEXTVAL, sum(col),number
> from table
Received on Tue Aug 24 1999 - 10:20:08 CDT

Original text of this message

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