Subject | Re: [firebird-support] Re: update from 2 tables |
---|---|
Author | Svein Erling Tysvaer |
Post date | 2006-06-23T07:58:26Z |
Alan McDonald wrote:
b.y, then a.p will be set to null and not left at the value it
originally was. Of course, that may be what he wants, but what would be
more common to want is
update TableA a
set a.p=(select b.q from TableB b where b.y=a.x)
where exists(select * from TableB c where c.y=a.x)
Set
>> --- In firebird-support@yahoogroups.com, "cbll_lam" <cbll_lam@...>There is actually a slight problem with this. If a.x doesn't match any
>> wrote:
>>> Thank you for pointing out my mistake. I must mixing it up with
>>> something else.
>>>
>>> It begs another question: how to do it in FB?
>>>
>>> Any suggestion will be appreciated.
>>>
>>> regards,
>>> bill
>>>
>
> what about
> update a set a.p=(select b.q from b where b.y=a.x);
b.y, then a.p will be set to null and not left at the value it
originally was. Of course, that may be what he wants, but what would be
more common to want is
update TableA a
set a.p=(select b.q from TableB b where b.y=a.x)
where exists(select * from TableB c where c.y=a.x)
Set