ITPub博客

首页 > 数据库 > MySQL > MySQL 多表更新的限制

MySQL 多表更新的限制

原创 MySQL 作者:feelpurple 时间:2016-08-04 22:42:50 0 删除 编辑
在对多表进行更新时,不支持ORDER BY、LIMIT。

mysql> update Subscribers2 s,tmp_Subscribers_01 t  set s.date='2015-01-01',
    -> s.LastAccessTimeStamp=unix_timestamp(date '2015-01-01')
    -> where s.MSISDN=t.MSISDN and t.id between 1 and 5000 limit 2000;
ERROR 1221 (HY000): Incorrect usage of UPDATE and LIMIT

mysql> update Subscribers2 s,tmp_Subscribers_01 t  set s.date='2015-01-01',
    -> s.LastAccessTimeStamp=unix_timestamp(date '2015-01-01')
    -> where s.MSISDN=t.MSISDN and t.id between 1 and 5000 order by s.date;
ERROR 1221 (HY000): Incorrect usage of UPDATE and ORDER BY

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26506993/viewspace-2123001/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-08-01

  • 博文量
    404
  • 访问量
    1673978