任何人都可以解释一点点有点&和|操作在sql中工作? [英] can anyone explain how bit wise & and | operation works in sql?

查看:65
本文介绍了任何人都可以解释一点点有点&和|操作在sql中工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是面试问题之一





this was one of interview question


select 1000&555

its giving 

552 as output 


select 1000|555

its giving 

1003 as output 





我的问题是如何来552和1003



my question is how come 552 and 1003

推荐答案

要解释什么?请阅读文档:按位运算符(Transact-SQL) [ ^ ]

秘密是二进制表示数字......
What to explain? Please read the documentation: Bitwise Operators (Transact-SQL)[^]
A secret is in binary representation of numbers...


http://www.blackwasp.co.uk/SQLBitwiseOperators.aspx



兑换数字二进制然后执行逻辑AND或OR运算符
http://www.blackwasp.co.uk/SQLBitwiseOperators.aspx

convert number in binary then perform logical AND or OR operator


这篇关于任何人都可以解释一点点有点&和|操作在sql中工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆