huifeng
V2EX  ›  问与答

不懂就问,请教 oracle 的位操作

  •  
  •   huifeng · Sep 16, 2021 · 1563 views
    This topic created in 1886 days ago, the information mentioned may be changed or developed.

    select UTL_RAW.BIT_AND(HEXTORAW('ead11'),HEXTORAW('1')) from dual; 这个结果为什么么是 00AD11 ? 按我的理解不应该是 00001 吗

    huifeng
    huifeng
    OP
    Sep 16, 2021
    1
    看了下方法说明 然后更不明白了
    select UTL_RAW.BIT_AND(HEXTORAW('ead11'),HEXTORAW('00001')) from dual; 显示是 000001
    huifeng
    huifeng
    OP
    Sep 16, 2021
    2
    方法说明:
    B.2.2 UTL_RAW.BIT_AND
    UTL_RAW.BIT_AND performs a bitwise logical AND operation on two raw values. If the values have different lengths, then the AND operation is terminated after the last byte of the shorter of the two values. The unprocessed portion of the longer value is appended to the partial result to produce the final result. The length of the resulting value equals the longer of the two input values.
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1127 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 23:37 · PVG 07:37 · LAX 15:37 · JFK 18:37
    ♥ Do have faith in what you're doing.