Mysql bit operation
1. MOD (X1, X2) calculates the remainder and returns the same remainder as "%" 2. X1 DIV X2 returns the operator for Division. The same as "/" 3. If the divisor is 0, the result is NULL. 4. <=> and = are the same. They are used to determine whether the operands are equal. The difference is that <=> can be used to judge null, = cannot judge null. Example: select null <=> null result 1 logical operator 1, and & or and: When all operands are not 0 and not null, the result is 1, if any operand is 0 and the result is 0, and one operand is null and no operand is 0, null is returned. Example: a,-1 & 2 & 3 results: 1 B, 0 & 3 Results: 0 c, 0 & null results: 0 d, 3 & null results: null2, or | or, for example: a, 1 |-1 | null | 0 result 1 B, 3 | null result 1 c, 0 | null result null d, null | null result null e, 0 | 0 result 03, non! Or not example: ,! Null result null4, exclusive, or xor: if the same value is 0, the value is 1. If any of the operands is null, null is returned. All numbers greater than-1 and less than 1 in mysql are regarded as logic 0, while other numbers are regarded as logic 1. example: a, null xor 1 result null B, null xor 0 result null c, 3 xor 1 result 0 d, 1 xor 0 result 1 e, 0 xor 0 result 0 f, 3 xor 0 result 1: bitwise AND | bitwise OR ~ Bitwise inversion ^ bitwise XOR or <bitwise left shift> the bitwise right shift operation first converts the operand to the binary number, and then performs bitwise operations, finally, convert the calculation result from binary to decimal. Note: bitwise operators must be in decimal format. If they are binary or octal values, you must use the CONV () function to convert the operands to decimal values. To perform bitwise operations.