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: SQL and boolean stuff

Re: SQL and boolean stuff

From: Syltrem <syltremzulu_at_videotron.ca>
Date: Tue, 2 Mar 2004 09:53:06 -0500
Message-ID: <Qb11c.529$Xy3.2004@tor-nn1.netcom.ca>


"Pizza Goldberg" <PizzaGoldberg_at_hotmail.com> a écrit dans le message de news:e_Gdnb2pSYVfBd7dRVn-gg_at_comcast.com...
> "Syltrem" <syltremzulu_at_videotron.ca> wrote in message
> news:mlO%b.357$Xy3.1178_at_tor-nn1.netcom.ca...
> > Hi
> >
> > Is it possible to do something like this:
> >
> > select decode(1=1, true, 'true', 'false') from dual;
> >
> > instead of 1=1, in real life I would do something like "colum1 < 10" or
> > "column2 > 'G'", for example
> >
> > I don't want to have to write a function, etc.
> > I just want to know if getting a true or false boolean value is possible
> >
> > Thanks for suggestions
> > Oracle 817 or +
> >
> > --
> > Syltrem
> >
>
>
> Yes, if you can not use CASE, do it this way:
>
> select
> decode(
> sign (column1 - 10)
> ,1, 'Greater_then_VAL'
> ,0, 'Equal_VAL'
> ,-1, 'Less_then_VAL')
> from dual
>
>
> You can set GT and LT and EQ to what you want....in your case
>
> GT and LT would be 'FALSE' and EQ would be 'TRUE'
>
>

SIGN function is great for what I need to do ! Thanks!

-- 
Syltrem

OpenVMS 7.3-1 + Oracle 8.1.7.4
http://pages.infinit.net/syltrem (OpenVMS related web site, en français)
---zulu is not in my email address---
Received on Tue Mar 02 2004 - 08:53:06 CST

Original text of this message

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