What's the best way to do a bitwise comparison in a sql query
such as the one indicated below - for example - i have one
Indicator field (currently defined as numeric) in my table which
is being used to store a variety of indicators (rather than
having a slew of boolean columns)

eg (random examples):

byte 1 indicates IsRetired (val 1)
byte 2 indicates IsOnDisability (val 2)
...
byte 4 indicates IsOverSixFeetTall (val 8)

ex: if the Indicator value = 9 (byte 1001) then IsRetired = true
,IsOnDisability = false and IsOverSixFeetTall = true

In vb - to determine whether a hex flag is on or not, we do a
bitwise comparison such as 

IsRetired = (Indicator and 1)
IsOnDisability = (Indicator and 2)
IsOverSixFeetTall = (Indicator and 8)

How do I mimic this sort of behavior in sqlite?

For example  -

Select * from MyTable Where (Indicator and 1)

Any help is appreciated.

________________________________________________
Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

Reply via email to