Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Table 1 = mov_estoque
- Table 2 = saidas
- Table 3 = produtos
- Table 4 = movimentoTable 5 = nf
- select m.DATA,n.NOTA,p.COD_PRODUTO,p.DESCRICAO1,p.FATOR_CA,m.EMPENHO
- from mov_estoque as m
- inner join saidas as s on m.origem = s.saida
- inner join produtos as p on m.produto = p.produto
- inner join movimento as t on m.origem = t.cod_operacao
- inner join nf as n on s.saida = n.cod_operacao
- 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'
- group by m.produto
- order by m.data
Add Comment
Please, Sign In to add comment