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);

 

posted @ 2021-07-06 11:01  newmiracle宇宙  阅读(651)  评论(0编辑  收藏  举报