Solved

ORA 00933 - SQL command not properly ended

Posted on 2008-10-10
3
1,020 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 74

Expert Comment

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

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Create table from select - oracle 6 68
how to trim oracle sql sentence in unix 17 70
Can't Access My Database 57 86
Creation date for a PDB 5 63
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

733 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