Subject | Re: [firebird-support] Re: Basic SQL Update query question |
---|---|
Author | Svein Erling Tysvaer |
Post date | 2006-11-02T22:24:07Z |
Of course you're right Milan, wonder where I left my brain today...
Sorry,
Set
Milan Babuskov wrote:
Sorry,
Set
Milan Babuskov wrote:
> Svein Erling Tysvaer wrote:
>> Moreover, not every IN can be translated to EXISTS (or rather, not every
>> 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).
>
> select * from rdb$database r1
> 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)