Subject | Re: [firebird-support] Insert from query, but changing one field? |
---|---|
Author | Helen Borrie |
Post date | 2003-10-21T23:13:34Z |
At 07:50 PM 21/10/2003 -0300, you wrote:
take all of the enrollments (rows in this table), and copy them to all to
another class. "
heLen
>Hi,Quite true: my suggestion was based on Joe saying "What I want to do is
>
>At October 21, 2003, 19:43, Helen Borrie wrote:
>
> > At 01:02 PM 21/10/2003 -0700, you wrote:
> >>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
>
>I think it should be: where classid=123. Otherwise, it would copy the
>students from all the other classes and put them into one.
take all of the enrollments (rows in this table), and copy them to all to
another class. "
heLen