Daca sunt cerute firmele cu capital strain, eu am in vedere si firma_mama, chiar daca nu au asociati si capital social
select firma.cui, firma.cod_inmatriculare codj, nvl(substr(FIRMA_MAMA.FIRMA_MAMA,1,200),' ') denfm,
adresa.localitate, n_tara.denumire tara, substr(firma.denumire,1,254) denfirma
from adresa,n_tara,firma,n_tip_adresa,FIRMA_MAMA, sediu
where n_tara.cod is not null and n_tara.cod <>'642'
and
n_tara.id=adresa.id_tara
and FIRMA_MAMA.id_sediu=
sediu.id and sediu.id_adresa=
adresa.id and
firma.id=FIRMA_MAMA.id_firma
and NOT exists(select 1 from stare_firma
where stare_firma.id_firma=
firma.id and stare_firma.id_stare_firma in
(select
n_stare_firma.id from n_stare_firma
where cod = 1084 ) )
and adresa.id_tip_adresa=
n_tip_adresa.id(+)