Ich habe eine transactions
Tabelle.MySQL Abfrage für Datumsbereich Transaktionen Anweisung
id account_id trx_date trx_type amount remarks
------ ---------- ---------- -------- ------ ---------
1 1 2017-12-10 DEPOSIT 500 test
2 1 2017-12-11 DEPOSIT 500 test
3 1 2017-12-12 DEPOSIT 6000 test
4 1 2017-12-13 WITHDRAW 300 test
5 1 2017-12-13 DEPOSIT 200 test
Ich möchte in diesem Format führen, aber ich kann nicht herausfinden, wie die Abfrage für das Abrufen von Daten wie folgt sein wird. Hier sind alle Felder gleich transactions
Tabelle. op_bal
, cl_bal
sind dynamisches Feld.
date trx_type op_bal amount cl_bal
2017-12-12 DEPOSIT 1000 6000 7000
2017-12-13 WITHDRAW 7000 300 6700
2017-12-13 DEPOSIT 6700 200 6900
Was ist die Logik/Kriterien hinter dieser Ergebnismenge? –
params: account_id, frm_dt, to_dt –
Er fragt nach der gewünschten Logik in der Ergebnismenge. Sieht aus wie 60000 sollte 6000 sein. – jit