資料庫表的遷移複製的SQL操作,資料庫遷移複製sql

來源:互聯網
上載者:User

資料庫表的遷移複製的SQL操作,資料庫遷移複製sql

在項目中,有時我們想備份表的資料,那麼把原先的表複製到另一個表中,當然,要求欄位要一致。

下面是測試的sql語句

  Insert into Tb_Dispatch_Mail_History(mail_no ,post_batchno ) select mail_no ,post_batchno  from Tb_Dispatch_Mail_Post tp  where tp.post_batchno='01111'

測試是通過,可以在
Tb_Dispatch_Mail_History
看到從下表

Tb_Dispatch_Mail_Post
遷移過來的資料。

insert into 表 select  。。。這樣的形式。

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.