Hi, I'm new to the forums and a begginer at SQL, hope this is the right place to post my request. I'm hoping someone knows a good example on how to do the following:
Table A
binID screwsNeeded 1 6 2 10 3 5
Table B
orderID screwsOrdered 100 1 101 6 102 4 103 10
Table A shows I have 3 bins, each bin is missing a set number of screws.
Table B shows the I've bought the 21 missing screws form 4 different sources.
So what I need to do is create a query that shows how are the screws distributed among the 3 bins.
Query:
binID orderID screwsReceived 1 100 1 1 101 5 2 101 1 2 102 4 2 103 5 3 103 5
I've googled around, but I come up empty, maybe I'm not using the right keywords?
Thanks in advance,
Fernando