首页 > 数据库 > MySQL > 正文

MySQL 多表更新的限制

2022-07-31 18:43:00
字体:
来源:转载
供稿:网友
        在对多表进行更新时,不支持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

(编辑:错新网)

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表