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 -> Re: Help with Oracle9i: SQL

Re: Help with Oracle9i: SQL

From: mcstock <mcstockspamplug_at_spamdamenquery.com>
Date: Thu, 6 Nov 2003 10:05:13 -0500
Message-ID: <9NydndDXyY7H_jeiRVn-vg@comcast.com>


if you look at your error messages you'll find some of your problems if you read the DECODE function description more carefully you'll see what you're missing for the 3%
if you think through what you're trying to accomplish you'll refine the return values of your decode statement
no offense intended, but could these steps perhaps what your professor is trying to get you to learn to do?

more specifically, but hopefully not too specifically, i see problems related to:

  1. column alias syntax
  2. string literal syntax within the decode
  3. no default value on decode (logic problem, not syntax)
  4. decode returning wrong values (you need to return the new price, don't you? not just the pct increase? so what expression should you use to raise RETAIL by 10%? 15%?

> This is what i have done. I am pretty sure that you have to use the
> decode keyword.
> I have tried a number of different things so that is I am asking for
> help.
> The most recent statement I have used is :
> SELECT title, category, retail 'Current Price',
> DECODE(retail, 'COMPUTER', .10,
> 'FITNESS', .15,
> 'SELF HELP, .25)'REVISED RETAIL'
> FROM books;
>
> This is not working. I still have to figure out how to get the rest of
> the books to add 3%. I can't get the revised retail feild to
> calculate. That is why I am asking for help. I have been working on it
> for weeks and can't get it right. My proffessor won't help. I am
> stuck!!! Thanks, Taylor
Received on Thu Nov 06 2003 - 09:05:13 CST

Original text of this message

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