Re: SQL question ...
Posted in 1996
CSC CIS wrote:
>
> Lee
>
> How about
> DELETE FROM A WHERE
> C1 IN (SELECT C1 FROM B WHERE XXX)
> AND C2 IN (SELECT C2 FROM B WHERE XXX); >
Should this work? look at the following tables:
table A: | table B:
|
C1 C2 | C1 C2 XXX
----------------------------------------------
1 a c | a c xx
2 b h | b f xx
3 c g | j g xx
4 j v | c h xx
This will delete record 1, 2, and 3 from table A. I think the poster's
purpose is to match A.C1=B.C1 and A.C2=B.C2, only record 1 will be
deleted. There is a big difference between comparing each column and a
group of columns.
Weimin Yang