Update specific records
hi, i am tryin to update 6 specific records out of 400 odd. Problem is my statement is updating all 400 records.
UPDATE AM_X_422_2 am
SET
am.security_level =
(
SELECT
lev
FROM
(
SELECT
max(am.security_level) lev
FROM
(
SELECT
name,
no,
am.security_level
FROM
(
SELECT
am.code_name name,
LENGTH(am.code_name) no,
am.security_level,
am.mission_date
FROM
AM_X_422_2 am
ORDER BY
am.mission_date desc
)
WHERE
rownum < 11
)
WHERE
LENGTH(name) > 7
)over
WHERE
over.lev= am.security_level)
I want to update the security level to the highest security level for missions which are within the 10 most recent missions and where length of the first word of the mission code_name exceeds 7 characters.
|