Combine Rows with indirect relation
If you wrap
select
  max(x.members_present),
  max(x.patient_category)
from
(
  &lt;your query goes here&gt;
) as x
group by
  x.clientvisit_id,
  x.client_id 

around your current query you'll collapse those rows into one, removing the blanks.