Generate insert statements in excel format

This method may be data generated in the Excel spreadsheet sql statement is inserted, and then inserted into the database

Statement is as follows:

=CONCATENATE("INSERT INTO TABLENAME(id,name1,name2) VALUES('"&B2&"','"&C2&"','"&D2&"'')")

  The following figure as an example 

 

 

 The data indicative of B2 to row 2 column B in the Excel spreadsheet, also note data to be inserted corresponding to the field name Good 

If you want to simply click on the selected volume generated statement row, and then drag down

 

 Also, if you want to generate primary key uuid type may be used as follows

=CONCATENATE("INSERT INTO TABLENAME(id,name1,name2) VALUES(uuid(),'"&C2&"','"&D2&"'')")

  

 

Guess you like

Origin www.cnblogs.com/lxxcn/p/12016775.html