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!

SQL Query to Update a column based on condition...

InfantrajMay 17 2015 — edited May 17 2015

Hi,

I'm trying to update the BITWISE field based on the DONT_CALL field... If the value in dont_call column is exist in any of the column P1,P2,P3 then the BITWISE column has to be updated by condition...

Untitled.png

Ex For first row In dont_call column i have 67890 , it is exist in P2 so the expected result in BITWISE column is 010...

I have tried

SELECT

DECODE(BITAND(P1,1), dont_call, 1, 0)||

DECODE(BITAND(P2,1), dont_call, 1, 0)||

DECODE(BITAND(P3,1), dont_call, 1, 0) test

FROM test_bit_wise;

But the result comes differently...

Untitle1d.png

Thanks in advance

Infant

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 14 2015
Added on May 17 2015
3 comments
396 views