Reputation: 15912
How can I make a bitwise shift in MySQL? Is there any specific instruction or operator? If not, how to simulate it optimally?
Upvotes: 4
Views: 5089
Reputation: 22749
Looks like there is shift operators available, ie >> for right shift.
Upvotes: 1
Reputation: 3093
To use a bitwise shift in MySQL, you can use <<
or >>
for left shift or right shift respectively.
Upvotes: 3
Reputation: 10268
Have a look at the bitwise operators in MySQL
first: http://dev.mysql.com/doc/refman/5.0/en/bit-functions.html
Then you have left shift:
http://dev.mysql.com/doc/refman/5.0/en/bit-functions.html#operator_left-shift
And right shift:
http://dev.mysql.com/doc/refman/5.0/en/bit-functions.html#operator_right-shift
Upvotes: 9