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!

Assigning one pivot column value to other pivot column in SQL

Hi Team,
Greetings!!!
We have one requirement where we have created a MV with some pivoted columns.
Now based on some further conditions is it possible that the value from one pivot column can be assigned to the other?

select rptno,patched,status, -- normal columns
retime, -- pivot column
closedtime -- pivot column
from carb_statustime_mv -- MV

Requirement: When status is in 1/2/3, map the time to RETime else map it to ClosedTime

Regards,
Sandeep

Comments
Post Details
Added on Sep 1 2022
3 comments
146 views