2
I have a table of statement of deposit and withdrawal of some customers, follows the table:
id_cliente|operação|valor |
----------+--------+------+
51298 | 01 | 50,00|
----------+--------+------+
51298 | 01 | 48,50|
----------+--------+------+
51298 | 02 | 13,67|
----------+--------+------+
51298 | 02 | 18,17|
----------+--------+------+
Transactions with amounts referring to 1 are deposits, with value 2 are withdrawals. How do I perform a query by returning the client balance value ? An sql that already returns the difference in values.
You’re not missing an "as" before "balance"?
– user28595
This tag is optional
– Nelson Teixeira