update with a select
Posted on 2011-03-24
I need to update the cost of the child item (ID 75) with the cost from the parrent Item divided by the parent quantity. in this case it would be 24/6 . this is all in the same table (item).
select ID, ParentItem, ParentQuantity, cost from ITEM
ID ParentItem ParentQuantity cost
75, 357, 6, 2
357, 0, 0, 24
so after the querry the child item would cost $4
good luck and thanks in advance.