zoukankan      html  css  js  c++  java
  • mysql 位操作

    Bitwise OR:
    mysql> SELECT 29 | 15;
            -> 31
    The result is an unsigned 64-bit integer.

    &
    Bitwise AND:
    mysql> SELECT 29 & 15;
            -> 13
    The result is an unsigned 64-bit integer.

    ^
    Bitwise XOR:
    mysql> SELECT 1 ^ 1;
            -> 0
    mysql> SELECT 1 ^ 0;
            -> 1
    mysql> SELECT 11 ^ 3;
            -> 8
    The result is an unsigned 64-bit integer.

    <<
    Shifts a longlong (BIGINT) number to the left.
    mysql> SELECT 1 << 2;
            -> 4
    The result is an unsigned 64-bit integer.

    >>
    Shifts a longlong (BIGINT) number to the right.
    mysql> SELECT 4 >> 2;
            -> 1
    The result is an unsigned 64-bit integer.

    ~
    Invert all bits.
    mysql> SELECT 5 & ~1;
            -> 4
    The result is an unsigned 64-bit integer.

    BIT_COUNT(N)
    Returns the number of bits that are set in the argument N.
    mysql> SELECT BIT_COUNT(29);
            -> 4

  • 相关阅读:
    索引
    mysql事务
    centos 7 gitlab安装服务器
    内网穿透工具 frp使用
    eslint配置
    nodejs连接mongodb(密码)
    插入排序
    直接插入排序
    koa中 log4js使用
    JS中的prototype、__proto__与constructor(图解)
  • 原文地址:https://www.cnblogs.com/MaxWoods/p/2490457.html
Copyright © 2011-2022 走看看