Subject | Re: [firebird-support] Insert from query, but changing one field? |
---|---|
Author | Daniel Rail |
Post date | 2003-10-21T22:50:27Z |
Hi,
At October 21, 2003, 19:43, Helen Borrie wrote:
students from all the other classes and put them into one.
--
Best regards,
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)
At October 21, 2003, 19:43, Helen Borrie wrote:
> At 01:02 PM 21/10/2003 -0700, you wrote:I think it should be: where classid=123. Otherwise, it would copy the
>>However, this will make duplicate copies of the enrollment record, meaning
>>that they'll still have classid 123. Somehow in the command, I need to
>>change the CLASSID of the newly inserted rows to, say, 456.
> Assuming you have a generator + trigger supplying the PK value, col1:
> insert into enrollments (col2, col3, ...., classid, ....)
> select col2, col3, ...., 456, ....
> from enrollments
> where classid <> 456
students from all the other classes and put them into one.
--
Best regards,
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)