程序员一代码搬运工
【Java学习心得和Java学习技术个人总结】

You can’t specify target table ‘caiji_data_meiwen’ for update in FROM clause

 

mysql 中不能自己 引用本身 要再加一层

不行

DELETE from `caiji_data_meiwen` where id not in (select id FROM `caiji_data_meiwen` a where a.desc like ‘%美文%’ )

可以 套一层

DELETE from `caiji_data_meiwen` where id not in ( select id from ((select id FROM `caiji_data_meiwen` a where a.desc like ‘%美文%’ )) b)

赞(0)
未经允许不得转载:程序员一代码搬运工 » You can’t specify target table ‘caiji_data_meiwen’ for update in FROM clause
分享到: 更多 (0)