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: No support for CASE keyword??

Re: No support for CASE keyword??

From: johnnie (isg cooper) <johnnie_at_prima.netfront.net>
Date: 1998/06/24
Message-ID: <Pine.BSI.3.96.980624193236.21390B-100000@prima.netfront.net>#1/1

It seems that DECODE does not support expression such as >, >=, <, <=, between. Am I right?

On Tue, 23 Jun 1998, John P. Higgins wrote:

> Try this:
> select stor_id, discount,
> decode(lowqty,NULL,highqty,lowqty)
> from discounts
>
> Teresa Larson wrote:
>
> > johnnie (isg cooper) (johnnie_at_prima.netfront.net) wrote:
> > : What is the difference between oracle DECODE and sql-server CASE function?
> >
> > Oracle's DECODE is a function (for lack of a better word) that is part of
> > the SELECT statement and allows you to substitute one value for another in
> > a result set. For example, if there are 2 values in a column called
> > gender F=Female and M=Male and you want to return the words Female/Male
> > rather than the code F/M, Oracle's DECODE function gives you that
> > capability.
> >
> > The CASE statement that became available in Sybase 11.5 doesn't appear to
> > be a function that is applied to a column the way DECODE is -- which is
> > similar to using functions like MIN and MAX and SUM. But it looks like it
> > can be used to give similar results. I say "looks like" because I do not
> > have 11.5 yet, so this is based on reading the on-line books. I checked
> > it out when I heard that this was a feature. :-) If you check out at the
> > examples in the book, however, it looks like the CASE statement offers a
> > little more flexibility. In particular, the following example:
> >
> > 3. select stor_id, discount,
> > case
> > when lowqty is not NULL then lowqty
> > else highqty
> > end
> > from discounts
> >
Received on Wed Jun 24 1998 - 00:00:00 CDT

Original text of this message

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