|Subject||RE: [firebird-support] Re: Multiple table update question|
> > As it did not work, I am going to try your solution.Hi Aege,
> > However, I have a question regarding the sql > >>UPDATE
> table1 T1 >>SET T1.field2 = (select T2.field2 FROM table2 T2
> >> where T2.field1 = T1.field1) where
> >>exists(select * from table2 T3
> >> where T3.field1 = T2.field1)
> > Is the where exist statement correct, or is there a typo?
> Is this what you meant by "typo":
> Can the last "T2.field1" have any relation to the "table2 T2"
> in the first select? I don't think so.
> Aage J.
No, I was refering to "where exists(select * from table2 T3
where T2.field1 = T2.field1)"
Which unless I have miss the point totally, which is very possible, you are
doing a comparison on the same field of the same table.
To solved the issue, I wrote an execute proc, but I am still interested in
your solution, as it would be much easier that what I have implemented.