Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Delete with multiple joins

630556Nov 8 2008 — edited Jan 24 2009
I have been trying for so lon to get this to work, but it is proving impossible. If you are interested in my table relationships, they can be found here [http://i33.tinypic.com/2gws12d.jpg]
I am trying to delete data from 2 tables on a certain condition. But i have to do multiple joins to do this is you look at my relationships. My main aim is to delete all data from tblCompetitor and tblResults where Event_Name is 100M Run and Round_Number = Round_1. I will show you the sql i am attempting, please egnore the syntax, it is done through java using JDBC, but you should be able to see what i am doing

delete r.result, c.Nationality, c.First_Name, c.Last_Name
FROM tblResults as r
inner join tblCompetitor as c on r.Competitor_ID=c.ID
inner join tblEvent e on r.Event_ID=e.ID
inner join tblRound ro on r.Round_ID=ro.ID
WHERE e.Event_Name = ?
AND r.Round_ID = ?

I am just at a total lost, so any help would be greatly appreciated
cheers
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 21 2009
Added on Nov 8 2008
4 comments
6,649 views