I have a database with lot No and quantity as below. I have to use first in first out concept (FIFO) to issue these materials
LOTNO
Quantity
1
2
2
4
3
13
If requested quantity is 1 the i have to decrease quantity of lotNo 1 by 1 if the requested quantity is more than the quantity...