Re: SQL question ...
Posted in 1996
In article <52ssot$j7m@cssun.mathcs.emory.edu>, Scott Rubin
<scottr@fourgen.com> writes
>Here is a way that should work for engines with pre-fragmented tables:
>
>
>select A.rowid as row_id
> from A, B
> where A.C1 = B.C1
> and A.C2 = B.C2
> and XXX
> into temp t1 with no log;>
>delete from A
> where rowid in (select row_id from t1);>
>-------------------------------------------------------------------------------
>
>At 07:15 PM 10/1/96 GMT, you wrote:
>>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 ...
Here is a way which will work under all versions but I'm not sure
why it works....(I got this from an Ingres expert and used to today).
This was joining on 4 columns deleting 26 rows out of ~1300. It does
work but why?? Just when I though I knew SQL....
delete from A where 1 in
(select 1 from A,B where A.C1 = B.C1 and A.C2 = B.C2)
--
David Williams