I have a table that keeps track of transactions.
The table is setup as:
transactions:
id, account_id, budget_id, points, type
I need to return each budget_id's sum of points where type = 'allocation' and sum of points where type = 'issue'
I know how to do each, but not both in one query.
expected result set:
budget_id allocated issued
434 200000 100
242 100000 5020
621 45000 3940
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…