select
si.id,
si.name,
cast(si.service_type as text) as service_type,
si.is_aggregate as parent_id,
sa.account
from ourpension.spr_indicator_bu si
join ourpension.spr_accounts_indicator_bu sa
on sa.spr_indicator_bu_id = si.id
where sa.account in (
'39035', '39035.1', '39035.2',
'39036', '39036.1', '39036.2',
'39037', '39037.1', '39037.2'
)
and (
'NPO' = any(si.service_type)
or 'PDS' = any(si.service_type)
)
order by sa.account, si.id