Subject | Re: [firebird-support] Help with a DELETE command |
---|---|
Author | Nando Dessena |
Post date | 2004-12-06T23:14:29Z |
Ann,
A> delete the qualifying rows from PARENT, CHILD or both?
Database servers that support "joined deletes" (OTTOMH I can only name MS SQL
Server) the syntax is slightly different (and unambiguous, if ugly).
Something along the lines of:
DELETE
FROM Child
FROM Child JOIN Parent ON Child.F_ID = Parent.F_CHILD_ID
WHERE Parent.F_FOO = 1;
assuming you want to delete from Child, that is.
Ciao
--
Nando Dessena
http://www.flamerobin.org
======================================================
I support Firebird, I am a Firebird Foundation member!
Join today at http://www.firebirdsql.org/ff/foundation
======================================================
>> DELETEA> That statement is not just illegal, it's ambiguous. Do you
>> FROM Child JOIN Parent ON Child.F_ID = Parent.F_CHILD_ID
>> WHERE Parent.F_FOO = 1;
A> delete the qualifying rows from PARENT, CHILD or both?
Database servers that support "joined deletes" (OTTOMH I can only name MS SQL
Server) the syntax is slightly different (and unambiguous, if ugly).
Something along the lines of:
DELETE
FROM Child
FROM Child JOIN Parent ON Child.F_ID = Parent.F_CHILD_ID
WHERE Parent.F_FOO = 1;
assuming you want to delete from Child, that is.
Ciao
--
Nando Dessena
http://www.flamerobin.org
======================================================
I support Firebird, I am a Firebird Foundation member!
Join today at http://www.firebirdsql.org/ff/foundation
======================================================