and:
select bitand(x,y)+0 from dual;or:
(x + y) - bitand(x, y);

解决方案 »

  1.   

    两个1之间的位与运算  
    SQL  >    select  to_number(bitand(1,1))  from  dual;  
     
    TO_NUMBER(BITAND(1,1))  
    ----------------------  
                                             1  
    1与0之间的运算:  
    SQL  >    select  to_number(bitand(1,0))  from  dual;  
     
    TO_NUMBER(BITAND(1,0))  
    ----------------------  
                                             0  
     
    0与0之间运算:  
    SQL  >    select  to_number(bitand(0,0))  from  dual;  
     
    TO_NUMBER(BITAND(0,0))  
    ----------------------  
                                             0