Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: bitmask comparison in a SELECT statement
"NoName" <nobody_at_nowhere.com> a écrit dans le message de
news:c2hbv7$672$1_at_grillo.cs.interbusiness.it...
> I can't find how to do a bitmask compare in a select.
> I explain: programmatically, if I want to know if a particular bit in a
> binary number is set, I do an "and" comparison, for example:
>
> decimal 5 = binary 101 101 and 100 = 100 (third bit is set)
> decimal 8 = binary 1000 1000 and 100 = 0 (third bit is not set)
>
> well, in a select statement, I thouth to do the same, like in this example:
>
> SELECT * from MyTable
> where (myBinaryNumber and 100) = 100
>
> ... how to write it correctly?
> Thanks
> Regards
>
>
Have a look at the BITAND function.
Regards
Michel Cadot
Received on Mon Mar 08 2004 - 03:00:11 CST