mysql临时表进行批量更新

mysql临时表进行批量更新

     $sql = "create temporary table tmp(id int(4) primary key,dr varchar(50))";
        $this->commonexecute($sql);
        $sql = "insert into tmp values  (23,'1243124'), (433,'1234')";
        $this->commonexecute($sql);


        $sql = 'update aa_copy_copy,tmp set aa_copy_copy.name=tmp.dr where aa_copy_copy.id=tmp.id';
        $this->commonexecute($sql);


如果遇到什么不懂的地方直接关注公众号留言(本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须在文章页面给出原文连接,否则保留追究法律责任的权利。)
作者:newmiracle
出处:https://www.cnblogs.com/newmiracle/

 
原文地址:https://www.cnblogs.com/newmiracle/p/14975947.html