Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

View para sincronizar os dados dos funcionários

create view vw_r034fun as

select a.numemp, a.codfil, b.numcgc, a.numcad, a.nomfun, a.dataadm, a.numcpf, a.numpis, a.sitafa, c.emapar

  from r034fun a

    left join r030fil b

     on b.numemp = a.numemp

   and b.codfil = a.codfil 

    left join r034cpl c

     on c.numemp = a.numemp

   and c.numcad = a.numcad

where a.tipcol = 1


View para sincronizar as fotos dos funcionários

create view vw_r034fot as

select a.numemp, a.codfil, a.numcad, c.fotemp

  from r034fun a

     left join r030fil b

      on b.numemp = a.numemp

    and b.codfil = a.codfil

     left join r034fot c

      on c.numemp = a.numemp

    and c.tipcol = a.tipcol

    and c.numcad = a.numcad

where a.tipcol = 1