Advertisement
otavioguerra

Query SDR nova

Jul 19th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- Query nova de selecao do sdr
  2.  
  3. select distinct p.num_cpf as cpf, 100 as melhornota,
  4. case when v.produtoid = 1 then 'NOVO'
  5.      when v.produtoid = 2 then 'REFIN'
  6.      when v.produtoid = 3 then 'PORTABILIDADE' end as melhorproduto,
  7. p.nome,p.email, p.telefone, p.matricula
  8. from meutudo.vendingmachine v
  9. inner join public.tb_pessoa_meutudo p on p.num_cpf = v.cpf and p.matricula = v.matricula
  10. where p.telefone is not null;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement