Data about synchronizing tables in different databases

Source: Internet
Author: User

Implement function: Synchronize the data of Ammeter table in database Db1 to Meter_bill table in DB2

The code is as follows:

 insert  into   Db2.meter_bill (oms_meter_id, house_id, Meter_no, Meter_number, First_quanti ty, zoom, Last_month, last_month_quantity, Last_month_create_date, Current_month, current_month_quantity , current_use_quantity, remark, create_by, Creation_date, last_updated_by, Last_updated_date, Delete_ Flag)  select   _id, house_id, Water_meter_no , Ext_meter_no, first_quantity, Zoom, Last_month, last_month_quantity, Last_month_create_date, Curren T_month, Current_month_quantity, current_use_quantity, remark, create_by, Creation_date, last_updated_by , Last_updated_date, Delete_flag  from  db1.ammeter 

In fact, the data from the DB1 ammeter table is inserted into the Meter_bill table in DB2, the main is the field names to correspond, mark!

Data about synchronizing tables in different databases

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.