I have three tables:
-
CustOrder:
id, CreateDate, Status -
DenominationOrder:
id, DenID, OrderID -
Denomination:
id, amount
I want to create a view based upon all these tables but there should be an additional column i.e. Total should be there which can calculate the sum of the amount of each order.
e.g.
- order 1 total denominations 3, total amount = 250+250+250=750
- order 2 total denominations 2, total amount = 250+250=500
Is it possible?
I try to guess your table relations (and data too, you did not provide any sample):