select utl_raw.bit_and('0','4') from dual; 或者 select bitand('6','4') from dual;
utl_raw这个包含有bit_and,bit_or及bit_complement等位运算函数。如:
SQL> select utl_raw.bit_and('01','11') from dual;
UTL_RAW.BIT_AND('01','11')
--------------------------------------------------------------------------------
01
SQL> select utl_raw.bit_or('01','11') from dual;
UTL_RAW.BIT_OR('01','11')
--------------------------------------------------------------------------------
11
SQL> select utl_raw.bit_xor('01','11') from dual;
UTL_RAW.BIT_XOR('01','11')
--------------------------------------------------------------------------------
10
求反函数
SQL> select utl_raw.bit_complement('01') from dual;
UTL_RAW.BIT_COMPLEMENT('01')
--------------------------------------------------------------------------------
FE
SQL>