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 09:59:10 -0500
Message-ID: <2Jedne0HqLlt_DeiRVn-vA@comcast.com>


when you say 'not working' what do you mean? do you get an error message, or wrong results?

"Taylor Wilkes" <tpw2021_at_aol.com> wrote in message news:b15b7649.0311060641.385de4a4_at_posting.google.com...
> ed.prochak_at_magicinterface.com (Ed prochak) wrote in message
news:<4b5394b2.0311051439.59d46555_at_posting.google.com>...
> > tpw2021_at_aol.com (Taylor Wilkes) wrote in message
news:<b15b7649.0311050901.4a0b805d_at_posting.google.com>...
> > > Here is the question:
> > > Management is proposing to increase the price of each book. The amount
> > > of the increase will be based on each book's category, according to
> > > the following scale:computer books, 10%; fitness books, 15%; self-help
> > > books, 25%; all other categories, 3%. Create a list that displays each
> > > book's title, category, current retail price, and revised retail
> > > price. The prices should be displayed with two decimal places. The
> > > column headings for the output should be as follows: Title, Category,
> > > Current Price, Revised Price.
> > >
> > > Table being used: BOOKS
> > >
> > > ISBN NOT NULL VARCHAR2(10)
> > > TITLE VARCHAR2(30)
> > > PUBDATE DATE
> > > PUBID NUMBER(2)
> > > COST NUMBER(5,2)
> > > RETAIL NUMBER(5,2)
> > > CATEGORY VARCHAR2(12)
> > >
> > > I believe that I am supposed to be using the DECODE keyword. I have
> > > other info if needed.
> > > Can anyone help??? Thanks
> >
> > This is written so much like a homework assignment, it is scary.
> >
> > Taylor, what have you tried? Put some sample SQL that you wrote. (We
> > try not to give answers to students, just to hint to them.) Can you
> > create the report up to the new price part?
> >
> > Please show us some effort. (That may sound mean, but we have jobs to
> > do too.)
> >
> > Enjoy,
> > Ed
>
>
>
> 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 - 08:59:10 CST

Original text of this message

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