Re: SQL question ...
Posted in 1996
Lin-Chuan Lee writes:
*
* Assume I have table A with composite key C1, C2 and
* table B with composite key C1, C2 .
*
*
* How do I delete from A where C1,C2 in(select C1,C2 from B where XXX) ;
*
* Assume C1,C2 may not be chars so no || deals ...
* also, no cascading deletes ...
Try this:
delete from A
where exists (select c1, c2 from B
where c1 = A.c1 and c2 = A.c2)
HTH,
-----------------------------------------------------------------------------
Robert Minter Data Systems Support
Senior Software Engineer A Client Technologies Company
E-Mail: rob@dssmktg.com Tel: 714.771.0454
Fax: 714.771.3028
#include <std_disclaimer.h> http://www.dssny.com