![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
hi all. i want to Produce *total sales per month per indicated region. The total should include only sales of products with more than 4,000,000 total sales. i did the following but it is giving me huge number: somebody please tell me why? SELECT TO_CHAR(purinv.Inv_Date,'mm') || ' - ' || TO_CHAR(purinv.Inv_Date,'yy') as "MONTH", sum(decode(cust.region, 'West', sales.qty*salpmt.amount, 0)) as "West", sum(decode(cust.region, 'North', sales.qty*salpmt.amount, 0)) as "North" from *prod, cust, salpmt, sales, purinv where salpmt.cust_code = cust.code and cust.region in ('North','West') and (sales.qty*salpmt.amount) > 4000000 group by TO_CHAR(purinv.Inv_Date,'mm'), TO_CHAR(purinv.Inv_Date,'yy') order by TO_CHAR(purinv.Inv_Date,'yy') thanks in advance |
#3
| |||
| |||
|
|
hi all. i want to Produce *total sales per month per indicated region. The total should include only sales of products with more than 4,000,000 total sales. i did the following but it is giving me huge number: somebody please tell me why? SELECT TO_CHAR(purinv.Inv_Date,'mm') || ' - ' || TO_CHAR(purinv.Inv_Date,'yy') as "MONTH", sum(decode(cust.region, 'West', sales.qty*salpmt.amount, 0)) as "West", sum(decode(cust.region, 'North', sales.qty*salpmt.amount, 0)) as "North" from *prod, cust, salpmt, sales, purinv where salpmt.cust_code = cust.code and cust.region in ('North','West') and (sales.qty*salpmt.amount) > 4000000 group by TO_CHAR(purinv.Inv_Date,'mm'), TO_CHAR(purinv.Inv_Date,'yy') order by TO_CHAR(purinv.Inv_Date,'yy') thanks in advance |
#4
| |||
| |||
|
|
hi all. i want to Produce *total sales per month per indicated region. The total should include only sales of products with more than 4,000,000 total sales. i did the following but it is giving me huge number: somebody please tell me why? SELECT TO_CHAR(purinv.Inv_Date,'mm') || ' - ' || TO_CHAR(purinv.Inv_Date,'yy') as "MONTH", sum(decode(cust.region, 'West', sales.qty*salpmt.amount, 0)) as "West", sum(decode(cust.region, 'North', sales.qty*salpmt.amount, 0)) as "North" from *prod, cust, salpmt, sales, purinv where salpmt.cust_code = cust.code and cust.region in ('North','West') and (sales.qty*salpmt.amount) > 4000000 group by TO_CHAR(purinv.Inv_Date,'mm'), TO_CHAR(purinv.Inv_Date,'yy') order by TO_CHAR(purinv.Inv_Date,'yy') thanks in advance |
#5
| |||
| |||
|
|
hi all. i want to Produce *total sales per month per indicated region. The total should include only sales of products with more than 4,000,000 total sales. i did the following but it is giving me huge number: somebody please tell me why? SELECT TO_CHAR(purinv.Inv_Date,'mm') || ' - ' || TO_CHAR(purinv.Inv_Date,'yy') as "MONTH", sum(decode(cust.region, 'West', sales.qty*salpmt.amount, 0)) as "West", sum(decode(cust.region, 'North', sales.qty*salpmt.amount, 0)) as "North" from *prod, cust, salpmt, sales, purinv where salpmt.cust_code = cust.code and cust.region in ('North','West') and (sales.qty*salpmt.amount) > 4000000 group by TO_CHAR(purinv.Inv_Date,'mm'), TO_CHAR(purinv.Inv_Date,'yy') order by TO_CHAR(purinv.Inv_Date,'yy') thanks in advance |
![]() |
| Thread Tools | |
| Display Modes | |
| |