loop in select statment
the first table
itemno required
1 10
2 40
3 50
the second table
lotno item qty
1 1 20
2 2 30
3 2 15
4 3 10
5 3 35
6 3 20
the result
itemno required lot qty/lot
1 10 1 10
2 40 2 30
3 10
3 50 5 35
6 15
i need how item need from lot to use it in production?
thanks