I'm getting an error while processing this query:
SELECT *
FROM example
WHERE pri IN (
SELECT pri
FROM (
SELECT pri
,sbst
,st
,count(*) AS cnt
FROM example
WHERE sbst = 'oi'
GROUP BY pri
) AS tmp
WHERE cnt = 1
AND st = 'ko'
)
AND sbst = 'cp';
the error is the following:
ORA-00907: missing right parenthesis 00907. 00000 - "missing right parenthesis" *Cause:
*Action: Error at Line: 5 Column: 136
But I don't think I missed a parenthesis.