Error Code:1093 是在执行DELETE或者UPDATE时含有子查询导致的。
You can't specify target table 'USER' from update in FROM clause
如:
UPDATE user SET usex = 4 WHERE
uage>(SELECT AVG(uage) FROM user);
可修改为:
UPDATE user SET usex = 4 WHERE
uage>(SELECT avg_uage FROM (SELECT AVG(uage) AS avg_uage FROM user) AS tmpuser);
Error Code:1248:
如果不在子查询后加别名AS tmpuser会报1248错误。