I haven't used subqueries or self-joins a lot... not sure if that's what I need though...
Here is what is needed - all in one table:
to update the cost of an inventory item in location 1 with the cost of the same item from location 2 (if it exists in location 2)...
Items and locations are in the same table.
There are some other criteria also (qty>0, etc. but they are not important for the problem I'm having)
SO:
TABLEONE
item_no
location
cost
which looks like:
ITEM_NO LOCATION COST
B01 01 25.00
B01 02 15.00
B02 01 20.00
B03 01 15.00
B03 02 12.00
At the end of the update query I want it to be:
ITEM_NO LOCATION COST
B01 01 25.00
B01 02 25.00
B02 01 20.00
B03 01 12.00
B03 02 12.00
I know this shouldn't be that difficult but I can't quite think it through..
Any help appreciated..
Here is what is needed - all in one table:
to update the cost of an inventory item in location 1 with the cost of the same item from location 2 (if it exists in location 2)...
Items and locations are in the same table.
There are some other criteria also (qty>0, etc. but they are not important for the problem I'm having)
SO:
TABLEONE
item_no
location
cost
which looks like:
ITEM_NO LOCATION COST
B01 01 25.00
B01 02 15.00
B02 01 20.00
B03 01 15.00
B03 02 12.00
At the end of the update query I want it to be:
ITEM_NO LOCATION COST
B01 01 25.00
B01 02 25.00
B02 01 20.00
B03 01 12.00
B03 02 12.00
I know this shouldn't be that difficult but I can't quite think it through..
Any help appreciated..