Subject | Re: [firebird-support] Basic SQL Update query question |
---|---|
Author | Milan Babuskov |
Post date | 2006-11-01T15:56:17Z |
vladman992000 wrote:
way", as IN can be much slower than EXISTS:
update collection COL
set COL.disp_browse = 'N'
where exists (
select 1 from user_account u
where COL.user_no = u.user_no
and u.expire_date = cast('NOW' as date));
--
Milan Babuskov
http://swoes.blogspot.com/
http://www.flamerobin.org
> update collection COLWell, others gave you the solution with IN, but that is not "the best
> set COL.disp_browse = 'N'
> where COL.user_no = (select u.user_no from user_account u where
> u.expire_date = cast('NOW' as date));
>
> What is the best way to re-write this statement
way", as IN can be much slower than EXISTS:
update collection COL
set COL.disp_browse = 'N'
where exists (
select 1 from user_account u
where COL.user_no = u.user_no
and u.expire_date = cast('NOW' as date));
--
Milan Babuskov
http://swoes.blogspot.com/
http://www.flamerobin.org