Quantcast
Channel: Question and Answer » oracle
Viewing all articles
Browse latest Browse all 717

ORA-00907: missing right parenthesis on query with subqueries

$
0
0

I am getting ORA-00907: missing right parenthesis for the following query:

SELECT PEOPLE.NAME FROM
CLIENTS K INNER JOIN PEOPLE ON K.ID_L = PEOPLE.ID_L
WHERE NOT EXISTS
(
(SELECT DISTINCT ARTIST.ID_U
FROM CLIENTS INNER JOIN ADORES ON CLIENTS.ID_L = ADORES.ID_L
INNER JOIN ARTIST ON ADORES.ID_U = ARTIST.ID_U
WHERE CLIENTS.ID_L = K.ID_L)
EXCEPT
(SELECT DISTINCT ARTIST.ID_U
FROM CLIENTS INNER JOIN BOUGHT ON CLIENTS.ID_L = BOUGHT.ID_L
INNER JOIN ARTWORK ON BOUGHT.ID_D = ARTWORK.ID_D
INNER JOIN ARTIST ON ARTWORK.ID_U = ARTIST.ID_U
WHERE CLIENTS.ID_L = K.ID_L)
)

I’ve checked both subqueries – both are ok. It works if I remove the EXCEPT and only use one subquery (but I need to actually test that both are equal).

Any idea on what the problem is?


Viewing all articles
Browse latest Browse all 717

Trending Articles