本文介绍了我如何更新表(MYSQL)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

系统抛出错误您不能在 FROM 子句中指定更新的目标表‘筛选’"我如何完成这样的更新?

the system throw a error "You can't specify target table 'screening' for update in FROM clause"How do I completed the update like this?

 UPDATE screening
  SET maileddate = date('Y-m-d', strtotime($mailed_date[$screeningId]))
  WHERE user_id IN (SELECT id FROM users
  INNER JOIN screening ON
  (users.id = screening.users_id
  AND screening.id = {$screeningId}))
  AND date BETWEEN 05-15/2011 AND 11-15-2011
  LIMIT 2

推荐答案

尝试将 LIMIT 子句放在 SELECT 子查询中.

Try putting the LIMIT clause in your SELECT subquery.

这篇关于我如何更新表(MYSQL)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-26 08:57
查看更多