Cumulative BITOR

Database
Enthusiast

Cumulative BITOR

Hi,

I want to write a sql which will help me find cumulative bitwise OR values as shown below - Most of the cumulative functions use SUM, AVG, MIN, MAX but I could not find a proper solution for this using Teradata SQL. Can someone please advise ? Thanks in advance.

SR value  BITOR_OP

1    1      BITOR(1,0)=1            

1    6      BITOR(6,1)=7                     

1    9      BITOR(9,7)=7  

2    1      BITOR(1,0)=1

2    5      BITOR(5,1)=5


Regards

Abhishek

Tags (1)
1 REPLY
Enthusiast

Re: Cumulative BITOR

 

Minor correction in the output ...sorry about that..

SR value  BITOR_OP

1    1      BITOR(1,0)=1            

1    6      BITOR(6,1)=7                     

1    9      BITOR(9,7)=15  (corrected this one)

2    1      BITOR(1,0)=1

2    5      BITOR(5,1)=5