delete from caixaitem where (id_encerravenda in
(select enc_001 from ENCERRAVENDA
where emp_001 = 1 and ven_001 = 6966)) and id_empresa = 1;


delete from ENCERRAVENDAITEM where 
(enc_001 in
(select enc_001 from ENCERRAVENDA
where emp_001 = 1 and ven_001 = 6966)) and emp_001 = 1;