MySql update two tables at once

前端 未结 4 1404
离开以前
离开以前 2020-11-30 06:26

I have two tables that need the exact same values for denormalization purposes.

Here\'s the query.

first table

UPDATE Table_One 
SET win = win+1         


        
4条回答
  •  有刺的猬
    2020-11-30 07:23

    If you can join the tables, then you could create a view of two tables, then update via that view. In your example it looks like userid might be a suitable key.

    In creating the view, you'd need to stick to the following guidelines.

提交回复
热议问题