n bits, where n is the second argument. Shifting left by n positions is equivalent to multiplying the number by 2^n.
Syntax
Parameters
Return Types
TheBIT_SHIFT_LEFT function returns a result of either type INT or BIGINT, depending on the type of the input <expression>.
Examples
Example The following code example shifts0001, the binary representation of 1, to the left by two bits, which yields 0100, the binary representation for 4:
Rows: 1Execution time: 6.13ms
00101, the binary representation of 5, to the left by two bits, which yields 10100, the binary representation of 20:
Rows: 1Execution time: 6.22ms
-3, which is 1111111111111101 in signed two’s complement, one bit to the left, resulting in 1111111111111010, the binary signed two’s complement of -6:
Rows: 1Execution time: 5.09ms