n bits, where n is the second argument. Shifting right by n positions is equivalent to dividing the number by 2^n.
Syntax
Parameters
Return Types
TheBIT_SHIFT_RIGHT 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 right by two bits, which yields 0000, the binary representation for 0:
Rows: 1Execution time: 5.33ms
00101, the binary representation of 5, to the right by two bits, which yields 00001, the binary representation for 1:
Rows: 1Execution time: 5.64ms
-3, which is 1111111111111101 in signed two’s complement, one bit to the right, resulting in 1111111111111110, the signed two’s complement of -2:
Rows: 1Execution time: 5.41ms