i have an mysql table with the following structure:
tblapp
app_id app_date app_price app_price_paid payment_id receipt_id expenses_enabled
1 01/01/2000 100 50 1 1 1
1 11/01/2000 10 20 3 2 0
1 21/01/2000 40 40 1 4 0
1 30/01/2000 30 30 2 1 1
I would like to have as columns
YEAR DETAILS Jan Feb ... Dec TOTALS
and rows
1. Price = sum app_price where expenses_enabled=1
2. PricePaid = sum app_price_paid where expenses_enabled=1
3. No = sum app_price where expenses_enabled=1 and receipt_id=1
3. Yes = sum app_price where expenses_enabled=1 and receipt_id=0
Desire output:
Year Details Jan Feb ... Dec Totals
2020 Price 130 0 ... 0 130
2020 Price_Paid 80 0 ... 0 80
2020 No 80 0 ... 0 80
2020 Yes 0 0 ... 0 0
Is it possible.