Subject Re: [ib-support] Newbie : Update with select statement
Author Svein Erling Tysvaer
Oh, it was just my ignorance because I've never even heard of T-sql.
However, it just makes things simpler:

UPDATE aktkonto
set batchid=:new_batchid
where aktkonto.batchcode = 1
and exists(select 1
from akt a2
where a2.aktid = aktkonto.aktid
and a2.EBV = 1)

HTH,
Set

At 04:03 27.08.2002 -0700, you wrote:
>Hi again!
>Thanks for your reply Set but:
>I think I was not clear when I asked my question. The
>:new_batchid is a parameter and not a field in akt. So
>I cant select it from akt.
>What I want is to update aktkonto only where it is
>connected to an akt via aktid and the akt has EBV = 1.
>I´m not sure I made it clearer by that explanation :-)
>
>The last part is not needed here but excellent in an
>other query so I´m going to use it there instead.