Need help correcting a SQL statement for Oracle

Dear fellow developers:

I have the following SQL query that I am trying to execute:

"DELETE from OWNER where OWNER.ID = USER.UID, OWNER.NUM = USER.NUM, OWNER.DATE = USER.DATE"

Open in new window

However, when I execute this code from C#, I am getting the error:

ORA-00933: SQL command not properly ended

I have two tables, OWNER, and USER.  Can anyone see what I am doing wrong?

Thanks in advance to all who reply.
fsyedAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

knightEknightCommented:
     

DELETE O
from OWNER O
join USER U
  on O.ID = U.UID
 and O.NUM = U.NUM
 and O.DATE = U.DATE
0
slightwv (䄆 Netminder) Commented:
No commas in a select and delete:

"DELETE from OWNER where OWNER.ID = USER.UID AND OWNER.NUM = USER.NUM AND OWNER.DATE = USER.DATE"

That said, where is USER coming from?  As is, it is still not valid.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sdstuberCommented:
where is USER defined?
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

slightwv (䄆 Netminder) Commented:
>>DELETE O from OWNER O join USER U

I'm not sure Oracle allows this syntax.
0
schwertnerCommented:
DELETE from OWNER where
(id, owner, date) IN (SELECT uid, num,date FROM USER);


 
0
sdstuberCommented:
delete owner where exists (select null from user where OWNER.ID = USER.UID and OWNER.NUM = USER.NUM and OWNER.DATE = USER.DATE)
0
fsyedAuthor Commented:
Thanks very much for your prompt replies.  With your help, I realized what my errors were, and I was able to figure out my mistake.  My query become much bigger, because I had to include some additional clauses, but thank to you guys, I was able to get the ball rolling.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Query Syntax

From novice to tech pro — start learning today.