Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Trying to update a field with the RANK function

J_ORCLJul 9 2012 — edited Jul 9 2012
Hi 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
)
This post has been answered by Solomon Yakobson on Jul 9 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 6 2012
Added on Jul 9 2012
7 comments
1,680 views