You can use the following excel statement:
="INSERT INTO table_name(`"&$A$1&"`,`"&$B$1&"`,`"&$C$1&"`, `"&$D$1&"`) VALUES('"&SUBSTITUTE(A2, "'", "\'")&"','"&SUBSTITUTE(B2, "'", "\'")&"','"&SUBSTITUTE(C2, "'", "\'")&"', "&D2&");"
This is better than Hart CO's answer as it takes column names into account and eliminates compilation errors due to quotation marks in the column. The end column is an example of a numeric value column without quotes.
Simon Baars Jul 07 '17 at 10:23 2017-07-07 10:23
source share