dapeng 2012-11-08 15:28:49 1279次浏览 1条回复 0 0 0

我想吧一个表A 的数据导到数据表B 里面

insert(A select * from B)

这中sql应该怎么构造啊

sql
  • 回复于 2012-11-13 09:21 举报
    $sql_participant="INSERT INTO oa_object_participant (oid,eid ,object_statue ,pid_str ,pid_weight ,width ,pid_class ,porportion,create_time,examine) select $oid, eid ,object_statue ,pid_str ,pid_weight ,width ,pid_class ,porportion,$create_time,'$examine' from oa_participant where eid=$id";
    $command_participant = Yii::app()->db->createCommand($sql_participant);
    $command_participant->execute(); 
    

    此贴结束

您需要登录后才可以回复。登录 | 立即注册