Friends, good evening, I hope and you can help me ...
I have the following inconvenience or good is not an inconvenience is rather ignorance ...
I have this table in Mysql
and I need to make a selection to the database and can show me the existence to date and I am doing it this way.
As you can see in the first image in the inventory movements, I select the balance + the entry - the exit to obtain the total, why do I put it in the where < = 'Date'? because if in the software I make a query on day 18 for example the query can not return null since the previous day there are stocks in the warehouse, now the error lies and if they are set is in the article repeated in the warehouse repeated, I explain. the amount 8 is from a movement in a past day but the net amount to date is 1.
THE MAIN QUESTION TAKING INTO ACCOUNT THE ABOVE IS HOW CAN I RECOVER THE FIRST RECORD OF THE DUPLICATE ARTICLE IN THE DUPLICATE WAREHOUSE, SINCE I AM HAVING AN ERRONEOUS INFORMATION?
I would really appreciate the soul of the person who wants to help me with this topic because I know it's simple but I do not know their solution.
Thank you very much.