Subject | Re: [firebird-support] Re: Basic SQL Update query question |
---|---|
Author | Milan Babuskov |
Post date | 2006-11-02T21:14:48Z |
Svein Erling Tysvaer wrote:
where
r1.rdb$security_class is not null and not exists
(select * from rdb$database r2
where r1.rdb$security_class = r2.rdb$security_class)
or
select * from rdb$database r1
where not exists
(select * from rdb$database r2
where r1.rdb$security_class = r2.rdb$security_class
and r1.rdb$security_class is not null)
--
Milan Babuskov
http://swoes.blogspot.com/
http://www.flamerobin.org
> Moreover, not every IN can be translated to EXISTS (or rather, not everyselect * from rdb$database r1
> NOT IN can be translated to NOT EXISTS):
>
> select * from rdb$database r1
> where r1.rdb$security_class not in
> (select r2.rdb$security_class from rdb$database r2)
>
> doesn't return any record in my database, whereas
>
> select * from rdb$database r1
> where not exists
> (select * from rdb$database r2
> where r1.rdb$security_class = r2.rdb$security_class)
>
> returns the record (in my database security_class IS NULL, I don't know
> if it ever has a value).
where
r1.rdb$security_class is not null and not exists
(select * from rdb$database r2
where r1.rdb$security_class = r2.rdb$security_class)
or
select * from rdb$database r1
where not exists
(select * from rdb$database r2
where r1.rdb$security_class = r2.rdb$security_class
and r1.rdb$security_class is not null)
--
Milan Babuskov
http://swoes.blogspot.com/
http://www.flamerobin.org