Subject SQL Problens
Author Alcir

I need create one calc of sum of sales. In my Application i have "Discount
by Item" and "Discount General", i need calc the sum of total sales. I use
the line:

SELECT SUM(b.PrItSale*b.QtItSale-DiscountItSale)-SUM(a.DiscountSale) FROM
Sale a, ItSale b
WHERE b.CodSale = a.CodSale

The problem: i give one discount general it repeat the discount for all
items of sale.

Excuse-me my english and thanks for any help.

Alcir Alexandre da Silva
Umuarama - ParanĂ¡ - Brasil