Trying to update a field with the RANK function
J_ORCLJul 9 2012 — edited Jul 9 2012Hi Everyone,
I am trying to update a field using a PL/SQL function rank. When I am trying to do it I do get an "+ORA-01427: single-row subquery returns more than one row+", and it is right as sometime I have the same value more than once.
Has anybody faced this issue before? I mean trying to update a field using the RANK function?
Please do not hesiate to contact me if any further info is required.
Best regards.
UPDATE spd_f_mkt_DC_2
SET RANKING_ID = (
SELECT RANK() OVER
(
PARTITION BY KPI_MKT_ID
ORDER BY F_MKT_KPI DESC
)
FROM SPD_F_MKT_DC_2
)