Migrate part of the data in the database table


According to the primary key id number in the database table (judging whether the id number in the message table of the led_statistic20170116 database already exists in the message table of the led_statistictest database), migrate the data of some related fields in the message table of the led_statistic20170116 database to the message table of the led_statistictest database middle

INSERT INTO led_statistictest.message(id,time,hasRead,content,recevier)
SELECT id,time,hasRead,content,recevier FROM led_statistic20170116.message
WHERE led_statistic20170116.message.id NOT IN (SELECT id FROM led_statistictest.message)


Execution process in navicat:
Query --> New Query --> Write Statement --> Run

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326403078&siteId=291194637