V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
huifeng
V2EX  ›  问与答

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

  •  
  •   huifeng · 2021-09-16 13:54:35 +08:00 · 491 次点击
    这是一个创建于 946 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    huifeng
        1
    huifeng  
    OP
       2021-09-16 14:00:25 +08:00
    看了下方法说明 然后更不明白了
    select UTL_RAW.BIT_AND(HEXTORAW('ead11'),HEXTORAW('00001')) from dual; 显示是 000001
    huifeng
        2
    huifeng  
    OP
       2021-09-16 14:02:04 +08:00
    方法说明:
    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.
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2766 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 12:24 · PVG 20:24 · LAX 05:24 · JFK 08:24
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.