0
I have a SELECT to return a list of products, but I want them to be differentiated by input and output, contains and does not contain...
Obs: I WANT TO TAKE THE LAST MOVEMENT OF EACH PRODUCT
Select that I have so far
SELECT DISTINCT *
FROM EstoqueGeral e
LEFT OUTER JOIN (
SELECT *
FROM produto_movimento
GROUP BY codigoproduto
) AS mvp ON mvp.codigoproduto = e.codigo2
LEFT OUTER JOIN (
SELECT DISTINCT *
FROM estoque_movimentacao
GROUP BY idmov
) AS em ON mvp.idmov = em.idmov
LEFT OUTER JOIN (
SELECT DISTINCT *
FROM clientes2
GROUP BY ID_cliente
) AS c ON c.cpf = em.cliente
ORDER BY `mvp`.`id_pm` DESC
LIMIT 15
RETURN
MOVING TABLE 2
TABLE OF PRODUCTS 3
TABLE PRODUCTS MOVED 4
SCHEDULE 5
you have some error like return or unwanted data ?
– Victor
it does not return error, it simply does not return the other tables
– Demetrios Felipe