You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

11 lines
465 B

select * from pbx_classifica_reg limit 10
select * from pbx_classifica_atendimento
select coalesce(c.clas_descricao, 'NI') as clas_descricao, coalesce(b.matricula, 'NI') as matricula, b.data_reg, a.*
from pbx_protocolo_reg a
left outer join pbx_classifica_reg b on b.id_bilhetes = a.uniqueid
left outeR join pbx_classifica_atendimento c on c.clas_id = b.clas_id
where exists(select '' from tmp_proto_pesquisa where num_protocolo = a.protoparceiro)