SQL to delete with possible NULL values

From: Edward Sullivan <es70_at_konichiwa.cc.columbia.edu>
Date: 17 Dec 1993 03:06:23 GMT
Message-ID: <2er7nf$qnn_at_apakabar.cc.columbia.edu>


I want to delete all the rows of a table which exist in another table, where my 'key' is more then one field & could be any combo of char, num or date.

I also do not want to use a 'where exists' due to the perfomance issues of joining the tables, which reside on different instances.

So I have come up with the following;

delete from table_x
where (key1, key2) in
(select key1, key2 from table_y where ....)

which works fine, UNLESS key1 or key2 is NULL, because it is testing for equality to NULL which will always fail.

So, Anyone have any suggestions? I'm using Oracle7.0.15, latest SQL*NET.

Thanks in advance. Received on Fri Dec 17 1993 - 04:06:23 CET

Original text of this message