where cluase help please

From: Totti <saliba.toufic.george_at_gmail.com>
Date: Tue, 15 Jan 2008 06:27:19 -0800 (PST)
Message-ID: <d4d1782f-d951-480d-a909-c002382b550c@v29g2000hsf.googlegroups.com>

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 Received on Tue Jan 15 2008 - 08:27:19 CST

Original text of this message