I'm having trouble performing an operation using MySQL, I do not even know if it's possible to do what I want.
I have a table_control table, in this table I have all operations that are performed with products.
In stock_control I have a column called typeMoviment which is 1 for input and 0 for output; What I want to do is this:
select * sum(quantidade) from controle_de_estoque where tipoMovimentacao = 0 MENOS select * sum(quantidade) from controle_de_estoque where tipoMovimentacao = 0
That is, I want to subtract one from the other but everything I try from the error.
Does anyone know what I can do?
Thank you.