select * from
(
select c.company_id, c.company_name_1 C, a.address_line_1_soundex A ,
rank() over (partition by c.company_id, a.address_line_1_soundex order by a.company_address_id) r
from company c, company_address a
where c.company_id = a.company_id
) s where r = 1
order by c
select c.company_id, c.company_name_1 C, a.address_line_1_soundex A ,
rank() over (partition by c.company_id, a.address_line_1_soundex order by a.company_address_id) r
from company c, company_address a
where c.company_id = a.company_id
order by c