How do get around Sequence number in Group By Query?

From: badri <badri_at_cc.gatech.edu>
Date: 1996/05/28
Message-ID: <4ogdpc$ln7_at_gaia.cc.gatech.edu>#1/1


Hi:

        Here is what I want to happen:

        I have a query of the following form:

	Insert into table1 (select sequence1.nextval, sum(col1), col2
				   from table2
				   group  by ...)

	Obviously ORACLE gives me the error that a sequence number is
not allowed in that group by query. How do I get by it?

        I can think of a before insert trigger that would change the new value of the column in table 1 to sequence_number.nextval. Is there a more elegant way?

thanks a lot,

-Badri Received on Tue May 28 1996 - 00:00:00 CEST

Original text of this message