Código:
Orders +--------+-----------+------------+--------+ | id | Order | SaleDate | Amount | +--------+-----------+------------+--------+ | 1 | H1 | 2014-02-10 | 300 | | 2 | H2 | 2014-02-10 | 110 | | 3 | H3 | 2014-02-10 | 1015 | | 4 | H4 | 2014-02-10 | 225 | | 5 | H5 | 2014-02-10 | 125 | | 6 | H6 | 2014-02-10 | 256 | | 7 | H7 | 2014-02-10 | 87 | +--------+-----------+------------+--------+ Payments +--------+------------+---------------+--------+ | id | PayDate | PaymentMethod | Amount | +--------+------------+---------------+--------+ | 1 | 2014-02-10 | Cash | 410 | | 2 | 2014-02-10 | Cash | 350 | | 3 | 2014-02-10 | Check | 1015 | | 4 | 2014-02-10 | Credit Card | 343 | +--------+------------+---------------+--------+
El problema es que los pagos no tienen referencia con las ordenes, me piden que haga la referencia (ordenes vs pagos) y guardarla en una tabla mediante los amounts, es esto posible?
Saludos!