mysql 一个较特殊的问题:You can't specify target table for update in FROM clause
即:不能先select出同一表中的某些值,再update这个表(在同一语句中),解决方案:查询时为表定义一个别名在取值
eg:
UPDATE `EDMGR_FORM_BASICINFO` SET `EDMGR_FORM_BASICINFO`.`BELONG_DOMAIN` = '' WHERE `EDMGR_FORM_BASICINFO`.`C_TYPE` = 'Question' AND `EDMGR_FORM_BASICINFO`.`PARENT_UID` = '24101479651ef4aa0b3a198099491771' AND `EDMGR_FORM_BASICINFO`.`USER_TYPE` = 'TEACHER' AND `EDMGR_FORM_BASICINFO`.`BELONG_DOMAIN` = (SELECT basic.CHILD_UID FROM (SELECT `EDMGR_FORM_BASICINFO`.`CHILD_UID` FROM `EDMGR_FORM_BASICINFO` WHERE `EDMGR_FORM_BASICINFO`.`BASIC_UID` = '85043510851f0bccad6bd96005630220') basic)