dbTalk Databases Forums  

how can i put multiple statmwnts in sum(case...

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss how can i put multiple statmwnts in sum(case... in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #21  
Old   
Totti
 
Posts: n/a

Default Re: how can i put multiple statmwnts in sum(case... - 01-06-2008 , 12:34 PM






as Charles pointed, i used the decode function as an if statement and
this solved my problem just like that:

sum(decode(cust_1.region, 'East', decode(prod_1.category, 'Base',
0.095,'Common', 0.115,
'Special',0.14, 0)*salpmt_1.amount, 0)) as "East", ...

that was it.
Thanks to all of you, you were all helpful

Reply With Quote
  #22  
Old   
DA Morgan
 
Posts: n/a

Default Re: how can i put multiple statmwnts in sum(case... - 01-06-2008 , 03:21 PM






Totti wrote:
Quote:
as Charles pointed, i used the decode function as an if statement and
this solved my problem just like that:

sum(decode(cust_1.region, 'East', decode(prod_1.category, 'Base',
0.095,'Common', 0.115,
'Special',0.14, 0)*salpmt_1.amount, 0)) as "East", ...

that was it.
Thanks to all of you, you were all helpful
Well done Charles. I was still trying to figure out what the question was.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #23  
Old   
DA Morgan
 
Posts: n/a

Default Re: how can i put multiple statmwnts in sum(case... - 01-06-2008 , 03:21 PM



Totti wrote:
Quote:
as Charles pointed, i used the decode function as an if statement and
this solved my problem just like that:

sum(decode(cust_1.region, 'East', decode(prod_1.category, 'Base',
0.095,'Common', 0.115,
'Special',0.14, 0)*salpmt_1.amount, 0)) as "East", ...

that was it.
Thanks to all of you, you were all helpful
Well done Charles. I was still trying to figure out what the question was.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #24  
Old   
DA Morgan
 
Posts: n/a

Default Re: how can i put multiple statmwnts in sum(case... - 01-06-2008 , 03:21 PM



Totti wrote:
Quote:
as Charles pointed, i used the decode function as an if statement and
this solved my problem just like that:

sum(decode(cust_1.region, 'East', decode(prod_1.category, 'Base',
0.095,'Common', 0.115,
'Special',0.14, 0)*salpmt_1.amount, 0)) as "East", ...

that was it.
Thanks to all of you, you were all helpful
Well done Charles. I was still trying to figure out what the question was.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #25  
Old   
DA Morgan
 
Posts: n/a

Default Re: how can i put multiple statmwnts in sum(case... - 01-06-2008 , 03:21 PM



Totti wrote:
Quote:
as Charles pointed, i used the decode function as an if statement and
this solved my problem just like that:

sum(decode(cust_1.region, 'East', decode(prod_1.category, 'Base',
0.095,'Common', 0.115,
'Special',0.14, 0)*salpmt_1.amount, 0)) as "East", ...

that was it.
Thanks to all of you, you were all helpful
Well done Charles. I was still trying to figure out what the question was.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.