Hi all I can not figure out a query. Any help would be appreciated.
So I have two tables Obligations and Payments
In Payments we have several or no rows pointing a single row in Obligations they look like this
Obligations Payments
----------- --------------
obligation_id payment_id
total fk_obligation_id
payment_summe
if_paid
ok so i need for every obligation_id to display its total
and sum(payment_summe) where if_paid=1 and
sum(payment_summe) where if_paid=2
So I have two tables Obligations and Payments
In Payments we have several or no rows pointing a single row in Obligations they look like this
Obligations Payments
----------- --------------
obligation_id payment_id
total fk_obligation_id
payment_summe
if_paid
ok so i need for every obligation_id to display its total
and sum(payment_summe) where if_paid=1 and
sum(payment_summe) where if_paid=2