I can not get this UPDATE statement to work in an Oracle environment. It was written for SQL server.
I am looking for some guidance on how to convert it.
UPDATE
SOB
SET
COA = CASE
WHEN
(
SELECT COUNT(*)
FROM SOB
WHERE
ORD = T.ORD AND
SHP_KEY <= T.SHP_KEY AND
SHP_DTTM <= T.SHP_DTTM AND
SOB_KEY <= T.SOB_KEY
) > 1 THEN 0
ELSE 1
END
FROM
SOB T
WHERE
COA IS NULL
Best Answer
Just remove the
FROM
clause and replace the reference to the alias with the table name: