Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: bitmask operations and SQL
There exists a (undocumented) function 'bitand' which allows to do what you
want. It doesn't return a boolean, but the result of the 'and' operation (27
and 4 = 4).
e.g.
select *
from x
where bitand(27,4) = 4
Unfortunately, there is no bitor nor bitxor.
Christopher J. Nalbone wrote in message <3562D2C5.9F83836A_at_bms.com>...
>Are there any SQL operators that support bitmask operations? I'd like
>to know if a certain bit within a number (integer) is set. For example,
>
> number in question number I'm interested in
> (decimal) (binary) (decimal) (binary)
> 27 11011 4 00100
>
Received on Thu May 28 1998 - 15:07:01 CDT
![]() |
![]() |