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