Use sql statement to store data from one table to another table

1. The table structure is shown in
the mcc table and the test0318 table.



2. The SQL statement is as follows:
1. The syntax is as follows:
NSERT INTO target table(field1, field2, ...) SELECT field1, field2, ... FROM source table;


2. The sql statement is:
insert into test0318(mcc,mccMD5,cityName,NameUUID) select mcc,MD5(mcc),cityName,UUID() from mcc

Among them, MD5(mcc) is to encrypt the mcc column with md5, and then put it into the table, UUID() is to generate the uuid number

3. The result is:


Guess you like

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