Fetch data from parent table that parent.baseAmount be greater than sum of childreen table.amount using Symfony-5.4 and Doctrine query builder

Viewed 50

I have two table

parent loan :

id baseAmount
1 1000
2 2000

child loanPayment

id loan_id amount
1 1 500
2 1 500
3 2 800
4 2 300

I need to retrieve data from loan where loan.baseAmount > SUM(loanPayment.amount) using Doctrine query builder

please answer me thank you

0 Answers
Related