1093 Error in MySQL table is specified twice

后端 未结 2 708
谎友^
谎友^ 2021-01-13 05:13

I\'m trying to update some rows. I only want to update the rows that have ID=0.

The error message I\'m receiving is:

1093 - Table \'ch_15_posts\' is specifie

2条回答
  •  长发绾君心
    2021-01-13 05:35

    You probably need something like that:

    UPDATE ch_15_posts AS t1
    JOIN (select MAX(ID)+1 as max FROM `ch_15_posts`) AS t2
    SET t1.ID = t2.max
    WHERE ID = 0
    

提交回复
热议问题