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 -> sum table

sum table

From: <ohahaahr_at_hotmail.com>
Date: 31 Aug 2005 07:54:13 -0700
Message-ID: <1125500053.500738.238430@z14g2000cwz.googlegroups.com>


Hi !

I have a very big table with 10 million transactions, that contains information about our sales (items, quantities, amounts, etc).

We run a lot af big (slow) querys, to get sales information.

A query could look like this:

Select st.itemnumber, sum(st.qty), sum(st.amount) from salestrans st group by st.itemnumber, To_Char(st.salesdate,'YYYY-MM')

This (simplified) query gives us the monthly sale for a specific article. Due to the size of the table, this query is slow.

Is there a method to make tables in oracle, maintaining the sums, for a specific itemnumber, for a specific period ???

Can it be done with a materialized view, a trigger, or in some other way???

We use oracle 10g.

Regards,
Ole Received on Wed Aug 31 2005 - 09:54:13 CDT

Original text of this message

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