On Nov 19, 2007 3:46 PM, Luiz K. Matsumura <luiz@planit.com.br> wrote:
> If someone can give me some hint I will apreciate.
This is more of a normalization problem. See:
http://www.deeptraining.com/litwin/dbdesign/FundamentalsOfRelationalDatabaseDesign.aspx
and lookup Third Normal Form.
You have a calculated total for each order, so I assume there's a
price for every product. You should join order_item to whichever table
has the individual cost for each product and multiply it by
order_item.qty.
Good luck.