How does not | (Bitwise OR) work in SQL Server/SSIS 2012? -
i've read bitwise or , seems functions same or except it's faster.
i read https://msdn.microsoft.com/en-us/library/ms186714(v=sql.110).aspx
and here example give:
use tempdb; go select a_int_value | b_int_value tablename
how expected run? makes no sense, cannot have or in select statement
1) missing something? 2) safe if comparison expressions of type integer, should use bitwise or? (this because bitwise or faster , works on integer comparisons?)
i don't have whole lot of experience flavor of sql, bitwise or not same thing or clause in statement.
the bitwise or or each bit of integer produce new integer example, numbers 2 , 9 can represented in binary 0010 , 1001. therefore
0010 | 1001 = 1011
in other words
2 | 9 = 11
the | operator in statement performing operation on results.
please note operation not equivalent addition i.e.
5(0101) | 3(0011) = 7(0111)
Comments
Post a Comment