Prévia do material em texto
select DISTINCT(pl.cod_conta) from x2002_plano_contas pl, x80_saldos_ccusto x where pl.ident_conta = x.ident_conta and PL.COD_CONTA not in ( select PL.COD_CONTA from x2103_contas_aglut_emp ag, X2002_PLANO_CONTAS PL where PL.IDENT_CONTA = AG.IDENT_CONTA AND ag.cod_empresa ='MTE') and x.dat_saldo between '01/01/2020' and '31/12/2020' ORDER BY PL.COD_CONTA /* SELECT AG.COD_EMPRESA, AG.COD_CONTA_AGLUT, pl.cod_conta FROM X2103_CONTAS_AGLUT_EMP AG, x2002_plano_contas PL WHERE AG.IDENT_CONTA = PL.IDENT_CONTA AND PL.COD_CONTA IN ('1101011203', '1101011224') and ag.cod_empresa = G15' */