Multiple Updates in MySQL

前端 未结 17 1007
南方客
南方客 2020-11-22 01:31

I know that you can insert multiple rows at once, is there a way to update multiple rows at once (as in, in one query) in MySQL?

Edit: For example I have the followi

17条回答
  •  既然无缘
    2020-11-22 01:56

    UPDATE table1, table2 SET table1.col1='value', table2.col1='value' WHERE table1.col3='567' AND table2.col6='567'
    

    This should work for ya.

    There is a reference in the MySQL manual for multiple tables.

提交回复
热议问题