I know there's probably an easy answer to this one, but I can't think of
it today! Help!
How do you do a delete from a target table where the keys are in another
table.
Example:
Target table:
batch#, Seq#, data values
Keys to delete table:
batch#, Seq#
Batch# and Seq# are the key values and must be a concatenated key set.
I was thinking something like
Delete from target_table a
where a.batch# = (select batch# from keystodelete_table b where
a.batch#=b.batch# and a.seq#=b.seq#) and a.seq#=(select b.seq# from
keystodelete_table where a.batch#=b.batch# )
Thanks much.
Rob
**************************************************************************************
This e-mail message and all attachments transmitted with it may contain legally privileged and/or confidential information intended solely for the use of the addressee(s). If the reader of this message is not the intended recipient, you are hereby notified that any reading, dissemination, distribution, copying, forwarding or other use of this message or its attachments is strictly prohibited. If you have received this message in error, please notify the sender immediately and delete this message and all copies and backups thereof.
Thank you.
**************************************************************************************
DB2 & UDB email list listserv db2-l LazyDBA home page