Multiple Updates in MySQL

前端 未结 17 1003
南方客
南方客 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:54

    UPDATE tableName SET col1='000' WHERE id='3' OR id='5'
    

    This should achieve what you'r looking for. Just add more id's. I have tested it.

提交回复
热议问题