Guest User

Untitled

a guest
Oct 23rd, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. Table 1 = mov_estoque
  2. Table 2 = saidas
  3. Table 3 = produtos
  4. Table 4 = movimentoTable 5 = nf
  5.  
  6. select m.DATA,n.NOTA,p.COD_PRODUTO,p.DESCRICAO1,p.FATOR_CA,m.EMPENHO
  7. from mov_estoque as m
  8. inner join saidas as s on m.origem = s.saida
  9. inner join produtos as p on m.produto = p.produto
  10. inner join movimento as t on m.origem = t.cod_operacao
  11. inner join nf as n on s.saida = n.cod_operacao
  12. where m.DATA>'2018-10-01' and s.filial='3' and p.tipo_prod='AC' and (t.evento='21' or t.evento='35') and m.tipo_origem ='S' and s.cancelada='F' and n.cancelada='F'
  13. group by m.produto
  14. order by m.data
Add Comment
Please, Sign In to add comment