I've query where I'm attempting to pull a list of accounts on active plan with the following parameters. But adding in the payment_plan_installment column is returning a lot of duplicate records, I would just like First name, last name, Account Number, Facility, Balance and only one unique installment amount This is the query I've and I'm only wanting unique installment amounts select b.patient_first_name as 'First Name', b.patient_last_name as 'Last Name', b.patient_account_number as 'Account Number', b.`location` as 'Facility', b.total_amount_due as 'PHH Balance', b.balance_remaining as 'Flywire Balance', g.guarantor_account_number as 'Guarantor ID', from bill b inner join institution i ON i.id = b.institution_id inner join guarantor g on g.consolidation_identifier_id = b.consolidation_identifier_id inner join payment_plan_bill ppb on ppb.bill_id = b.id inner join payment_plan pp on pp.id = ppb.payment_plan_id inner join payment_plan_installment ppi on ppi.payment_plan_id = pp.id where i.id in (372,373,374,427) and pp.payment_plan_status = 'ACTIVE' and b.balance_remaining = b.total_amount_due and b.balance_remaining != 0 and b.total_amount_due != 0; Continue reading...