zoukankan      html  css  js  c++  java
  • mysql update/delete in 子查询改写

    #子查询(不支持)
    update question q set q.`level`=2 where q.id in( select id from  question where id>=2111 limit 165,165);
    
    
    #改写
    update question q inner join ( select id from  question where id>=2111 limit 165,165) t on q.id=t.id set q.`level`=2;
    
    
    #子查询(不支持)
    delete from `user` where id in (
       select min(id) as id from `user` group by wx_open_id having count(1)>1
    );
    
    #改写
    delete from `user` where id in (
        select id from(    
           select min(id) as id from `user` group by wx_open_id having count(1)>1
        ) t
    );
  • 相关阅读:
    ctrl+shift+k取消
    ERROR 1872
    swap
    mysql主从跳过错误
    undo
    gtid
    falcon监控指标
    连接数
    datetime与timestamp相互转换
    截取文件内容
  • 原文地址:https://www.cnblogs.com/hdwang/p/9204217.html
Copyright © 2011-2022 走看看