SQL update from same table / multiple lists and items -


i need update table looks this:

no.    item    location        score     available     price   some_more_text 1      water   london                                  0,00 1      water   amsterdam       1         yes           1,11    alpha 1      water   burges          1         yes           1,11    alpha 2      honey   london                                  0,00 2      honey   amsterdam       5         yes           5,55    omega 2      honey   burges          5         yes           5,55    omega 3      spoon   london          4         yes           3,33    gamma 3      spoon   amsterdam       4         yes           3,33    gamma 3      spoon   burges          4         yes           3,33    gamma 4      books   london                                  0,00 4      books   amsterdam       1         no            2,55    alpha 4      books   burges          1         no            2,55    alpha 5      juice   london                                  0,00 5      juice   amsterdam       5         yes           5,55    beta 5      juice   burges          5         yes           5,55    beta ... 

in end every item in londen should have same properties according item in burges (or amsterdam, doesn't matter). can't done manually there many - cant find way somehow "batch" sql-command update every item same no.

one more problem: proprietary software can't language used - assume it's oracle.

you can join table on in update.

update table_x lon, table_x bur set lon.item=bur.item, lon.score=bur.score, etc lon.no=bur.no , lon.location="london" , bur.location="burges"; 

that updates london data burges


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -