I have two queries that work but I want the 2nd query to be done based on the results from the first query and join all results together.
First query was
select c.contribution_amount, c.contribution_dt,
c.contribution_descr,c.report_info_id,
p.name_last,p.name_first,p.name_organization,
p.employer,p.occupation,p.job_title,
a.city, a.state_cd, a.postal_code,
r.report_info_ident, r.filer_info_id
from contribution_info c
inner join contribution_persent cp on c.contribution_info_id=cp.contribution_info_id
inner join persent_info p on cp.persent_info_id=p.persent_info_id
inner join persent_address pa on p.persent_info_id=pa.persent_info_id
inner join address_info a on pa.address_info_id=a.address_info_id
inner join report_info r on c.report_info_id=r.report_info_id
where lower(p.name_last) like '%somebody%' or lower(p.name_organization) like '%somebody%'
and the second query was
select f1.filer_ident, fp1.filer_persent_kind_cd,
p1.name_last, p1.name_first,p1.name_organization, p1.persent_type_cd
from filer_info f1
inner join filer_persent fp1 on f1.filer_info_id=fp1.filer_info_id
inner join persent_info p1 on fp1.persent_info_id=p1.persent_info_id
where f1.filer_info_id=000000000
and fp1.filer_persent_kind_cd='FILER'
the second query's 00000000 needs to be equal to the first query's c.report_info_id
(also represented as r.report_info_id)
and the row result needs to be a combination of all the r, p, c, a, r1, fp1 results