Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> SQL help in RDB7
Hi, I have an SQL problem in RDB7. I have two tables,
RBX_RES_BATCH_XREF and DBH_DELV_BATCH_HIST where DBH_DELV_BATCH_HIST
contains a integer date field "DTE." Based on this date
field(RBX_RES_BATCH_XREF does not have a date field), I want to delete
records from both tables. A record in RBX_RES_BATCH_XREF matches the
record in DBH_DELV_BATCH_HIST only if the fields "DELV_BATCH" AND
"DELV_DEST" match. Will the following SQL statements accomplish this?
Why or why not?
delete from RBX_RES_BATCH_XREF RBX where RBX.DELV_DEST =
(select DELV_DEST from DBH_DELV_BATCH_HIST where DTE <= 19990225)
and RBX.DELV_BATCH =
(select DELV_BATCH from DBH_DELV_BATCH_HIST where DTE <= 19990225);
delete from DBH_DELV_BATCH_HIST where DTE <= 19990225;
I keep thinking that this will delete more records than I want to in RBX_RES_BATCH_XREF. Any help would be appreciated.
-Greg
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Received on Fri May 28 1999 - 11:04:57 CDT