Home  • Database • MySQL

Query to swap row values in mysql

First you have to create a tmp_field
update item_uom_factor  
set factor=(select factor from item_uom_factor where item_id=5 and level=3) where level=2 and item_id=5

update item_uom_factor  
set factor=(select factor_tmp from item_uom_factor where item_id=5 and level=2) where level=3 and item_id=5

Comments 0


Share

Copyright © 2024. Powered by Intellect Software Ltd