Subject Re: [firebird-support] SQL help needed
Author Milan Babuskov
tickerboo2002 wrote:
> Inside a Trigger, I'd like to perform an update if a select returns no
> rows. Something like the following:
>
> UPDATE foo f
> SET f.Finished=1
> where f.ID=100 and count( select bar_Id from bar where blah )=0
>
> What's the usual way of doing this?

The usual way is to use NOT EXISTS. It works fastest since it bails out
on the first record it finds.

--
Milan Babuskov
http://swoes.blogspot.com/
http://www.flamerobin.org