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

Home -> Community -> Usenet -> c.d.o.server -> Re: binary logic in SQL?

Re: binary logic in SQL?

From: Rodney Volz <rodney_at_watchtower.LF.net>
Date: 11 Jan 1999 07:11:47 GMT
Message-ID: <77c87j$95t$1@news.LF.net>


In article <36987ad0.1190652_at_read.news.globalnet.co.uk>, keith boulton <boulke_at_globalnet.co.uk> wrote:
>On 6 Jan 1999 14:35:12 GMT, rodney_at_watchtower.LF.net (Rodney Volz)
>wrote:
>
>>Is there any way to use bitmap masks in oracle? What
>>I need is something like:
>>
>> select * from emp where flags & 0x02 != 0;
>>
>>where "flags & 0x02" behaves as if it was C code.
>>
>>Thanks,
>>-Rodney Volz
>>
>I think you would be better advised to define a single character field
>with a value of either 1 or Y for true and null for false ( assuming
>you only want to retrieve true values). This would allow the use of
>indexes on the true/false columns in which only the true values would
>exist making the index small.

The application is a car database. The field I asked for is to be used for encoding of features like "air conditioning", "sunroof", "diesel", etc.

I want to be able to search for all cars with e.g. (AC & sunroof & !diesel) in a efficient way. Right now it's a combination of "field like '%sunroof%'" which of course is slow. Normalizing data, i.e. putting features and cars in different tables and using indexes to connect the tables didn't really help.

Regards,
-Rodney Received on Mon Jan 11 1999 - 01:11:47 CST

Original text of this message

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