Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> bitmask comparison in a SELECT statement

bitmask comparison in a SELECT statement

From: NoName <nobody_at_nowhere.com>
Date: Mon, 8 Mar 2004 09:50:05 +0100
Message-ID: <c2hbv7$672$1@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 Received on Mon Mar 08 2004 - 02:50:05 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US