As the title says. It's pretty self explanatory.
Each client have multiple payments and there are tons of them. I need to see how many payments each client have.
select ec.id as client_id , p.id as payment_id
from e_clients ec
left join payments p on ec.id = p.client_id
I'm guessing it's something I have already done but I can't seem to remember.
I have tried counting but it just returns 1 on each row.