SQL Sub Query Error ORA-00936: missing expression [message #611564] |
Thu, 03 April 2014 13:05 |
|
rlcaputo
Messages: 3 Registered: April 2014
|
Junior Member |
|
|
I get ORA-00936 when running this query. I am trying to flag one instance per clt_id of highest res_id number.
SELECT
R.RES_CLT_ID CLT_ID,
R.RES_ID RES_ID,
(select 'YES' from dual
where R.RES_ID = (
select max(lll.res_id)
from DBxxx lll
where
lll.res_clt_id = r.res_clt_id and
lll.DELETED <> 'Y'
)
) FLAG
FROM
DBxxx R
WHERE
R.DELETED <> 'Y' AND
R.RES_STARTDT IS NOT NULL
;
Any ideas???????????????
|
|
|
|
|
|
|