Solved

ORA 00933 - SQL command not properly ended

Posted on 2008-10-10
3
1,015 Views
Last Modified: 2013-12-19
Both of the following SQL statements give me the ORA 00933 error.

SELECT DISTINCT s.customer_name FROM depositor AS s WHERE NOT EXISTS ( (SELECT branch_name FROM branch WHERE branch_city = 'Brooklyn') EXCEPT (SELECT r.branch_name FROM depositor AS t, account AS r WHERE t.account_number = r.account_number AND s.customer_name = t.customer_name) );

SELECT t.customer_name FROM depositor AS t WHERE UNIQUE (SELECT r.customer_name FROM account, depositor AS r WHERE t.customer_name = r.customer_name AND r.account_number = account.account_number AND account.branch_name = 'Perryridge');

Any idea what is wrong with these query statements?  Yes, this is part of a homework assignment.  I am working on a graduate level database course and these two query statements have had me stumped for the last hour.  I am not asking anyone to do my homework, but any suggestions or guideance would be greatly appreciated.
0
Comment
Question by:doug5516
3 Comments
 
LVL 73

Expert Comment

by:sdstuber
ID: 22691828
The EXCEPT and WHERE UNIQUE clauses are not Oracle syntax
0
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 22694953
EXCEPT is available in MS SQL Server.

the WHERE UNIQUE is unkown to me...

there are other modification operators for subqueries:
ANY  SOME   ALL
http://msdn.microsoft.com/en-us/library/ms187074.aspx
0
 
LVL 17

Expert Comment

by:sweetfa2
ID: 22708140
Depends how you are running them.  Some tools will fail if you are using the incorrect scripting engine.  For example if you are using toad you could select a single statement and run the single statement without issue.

Otherwise, you could select a run as script option in which case you shouldn't have an issue.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Via a live example, show how to take different types of Oracle backups using RMAN.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now