Thread: Please help!
10-27-03, 15:14 #1Registered User
- Join Date
- Oct 2003
Unanswered: Please help!
Okay, I'm working on a small retail book store database and I need to view some revised prices. I THINK I should be using the DECODE function as shown below in my desperate attempt to complete this task. If not, a little push in the right direction would be MUCH appreciated!
SELECT title, category, retail "current retail price"
DECODE(category, "computer", retail*.90,
"self help", retail*.75,
retail*.97) "revised retail price";
I get an error everytime! I even tried having "FROM books" at the end.. that didn't work either! I'm so confused! PLEASE give me a hint as to how I can correct this...
I need to take the current retail price (retail) and according to the books category, issue a discount. I need to display the book title (title), the book's category (category), current retail price (retail) and revised retail price. Category discounts: computer = 10%, fitness = 15%, self help = 25%, and all others = 3%.
Please help me!
c|_O__ O| .oO(CHOO! CHOO!)
10-27-03, 15:27 #2Registered User
- Join Date
- Jun 2003
- West Palm Beach, FL
You need to re-order your SQL like this:
SELECT title, category, retail "current retail price", DECODE(category, "computer", retail*.90, "fitness", retail*.85, "self help", retail*.75, retail*.97) "revised retail price" FROM books;The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb