Bitwise exclusive OR in Oracle

前端 未结 3 1847
广开言路
广开言路 2021-01-18 07:34

In SQL Server I have been using the ^ symbol, however that doesn\'t seem to work in Oracle.

How do I do a bitwise exc

3条回答
  •  悲&欢浪女
    2021-01-18 08:07

    There's no easy way.

    You may cast string HEX values into RAW values and use UTL_RAW:

    SELECT UTL_RAW.bit_xor(HEXTORAW(TO_CHAR(1, 'FMX')), HEXTORAW(TO_CHAR(2, 'FMX')))
    FROM dual
    
    ---
     03
    

提交回复
热议问题