In general, when I have to handle Ledger type data (which this problem
is), I tend to hold data in 3 tables
1. Master Ledger ( Product ID, Name, etc)
2. Master Ledger Balances(Product ID, Fiscal_Year, Opening Balance,
Net_Transaction_P1, Net_Transaction_P2, ... etc)
3. Master Ledger Transact
Hi
For decades, this type of problem has been the meat and vegetables of
discussions about SQL programming and design.
One writer on this subject has stood out, thanks to his mental clarity
and ability to set out complicated concepts in a readily comprehensible
manner.
His name is Joe Celk