|
DECLARE @a INT
DECLARE @b INT
SET @a = 4
SET @b = 6
SELECT @a & @b as 'Bitwise AND',
@a | @b as 'Bitwise OR',
@a ^ @b as 'Bitwise exclusive OR',
~@a as 'Bitwise NOT',
~@b as 'Bitwise NOT'
|
Output |
Bitwise AND |
Bitwise OR |
Bitwise exclusive OR |
Bitwise NOT |
Bitwise NOT |
4 |
6 |
2 |
-5 |
-7 |
|