SELECT a.num_emp,a.cod_mov,b.clase_mov,a.cantidad,a.valor,b.cantidad_emp,cantidad_cia, b.ch_encabeza FROM notb00003 a,notb00002 b WHERE a.status_t is null and a.cod_mov = b.cod_mov UNION SELECT a.num_emp,a.cod_mov,b.clase_mov,a.cantidad,a.valor,b.cantidad_emp,cantidad_cia, b.ch_encabeza FROM notb00007 a,notb00002 b WHERE a.num_nomi = 9806 and a.tipo_emp = "Q" and a.status_t is null and a.cod_mov = b.cod_mov ORDER BY 1