Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Seqence Number Automation?
Try this
select seq.nextval, num, val from
(select num, sum(col) val from t group by num);
it will work fine.
Yan Zhou a écrit dans le message <7ps9a8$3ql_at_nntpa.cb.lucent.com>...
>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
> group by number;
>Then what should I do? Anybody can help my out?
>Thanks a lot,
>Yan
>
>
Received on Tue Aug 24 1999 - 02:44:03 CDT
![]() |
![]() |