6 ms·
Another solution would be to have a view that calculates the balance from the transactions. Then your sql code can check the balance without doing a sum (which
by dalore 10y ago
Another solution would be to have a view that calculates the balance from the transactions.
Then your sql code can check the balance without doing a sum (which might get expensive, and often the same value until a transaction changes it) just by joining to that view.
i.e. `WHERE total_view.balance > 0`