Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Seqence Number Automation?
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
![]() |
![]() |