Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Deleting records where they are in another table

Deleting records where they are in another table

From: Andreww <andrew.whittam_at_gmail.com>
Date: 30 May 2006 06:52:33 -0700
Message-ID: <1148997153.171935.205070@y43g2000cwc.googlegroups.com>


Hi - I am new to Oracle SQL and have the following question.

I have a table with records which have unique id's and dates in (uid may have a number of records) but the recs are uniq on uid+date.

Another table has the uid + max(date) record from the 1st table.

I want to delete the records in the 1st table that are from the 2nd table with the criterion being uid+date.

I have tried code like:

delete from table_A

      where (select from table_A A, table_B where B where a.uid=b.uid and

                a.date=b.date)

Which ever way I try I get some sort of error.

What I am after is the proper syntax structure to do the job.

Can anyone help?

Many thanks

Andrew Received on Tue May 30 2006 - 08:52:33 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US