Subject Re: [firebird-support] delete
Author Thomas Steinmaurer
> hello, I think this is a very old question, but I've been googling with no luck
> (probably I'm not using the right search keys?)
>
> Is this OK with FB2.1? Is there any other better way to do it? I have a
> master/detail table and I want to delete all the details from some kind of
> movement, but the kind of movement field is in the master table:
>
> DELETE FROM DETAIL
> WHERE
> (SELECT KIND_MOV FROM MASTER
> where MASTER.id = DETAIL.id) = 'SOME VALUE';

Perhaps?

delete from detail d
where
exists (
select
1
from
master m
where
m.id = d.id
and m.kind_mov = 'SOME VALUE'
)



--
Best Regards,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and
NexusDB V2
Upscene Productions
http://www.upscene.com
My blog:
http://blog.upscene.com/thomas/