left join telefonepessoa tpr on tpr.n_pessoa_pessoa = p.n_pessoa_pessoa and tpr.s_tip_telpessoa = 'R' and tpr.n_seq_telpessoa = (select max(tprm.n_seq_telpessoa) from telefonepessoa tprm where tprm.n_pessoa_pessoa = tpr.n_pessoa_pessoa and tprm.s_tip_telpessoa = tpr.s_tip_telpessoa) left join telefonepessoa tpc on tpc.n_pessoa_pessoa = p.n_pessoa_pessoa and tpc.s_tip_telpessoa = 'E' and tpc.n_seq_telpessoa = (select max(tpcm.n_seq_telpessoa) from telefonepessoa tpcm where tpcm.n_pessoa_pessoa = tpc.n_pessoa_pessoa and tpcm.s_tip_telpessoa = tpc.s_tip_telpessoa)