Bitwise shift in mysql

末鹿安然 提交于 2020-01-13 15:00:32

问题


How can I make a bitwise shift in MySQL? Is there any specific instruction or operator? If not, how to simulate it optimally?


回答1:


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




回答2:


To use a bitwise shift in MySQL, you can use << or >> for left shift or right shift respectively.




回答3:


Looks like there is shift operators available, ie >> for right shift.



来源:https://stackoverflow.com/questions/6670611/bitwise-shift-in-mysql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!