把excel的数据转成sql

参考 将excel表格数据转换为sql语句[转]Excel数据转化为sql脚本

 

1.在当前行的最后新增一列,假如是M 列,输入如下
insert into tb_student (seq_id,student_id,name,class_no,age,sex)

2.再新增一列,输入如下
=CONCATENATE(" ",M2," values ('",A2,"','",B2,"','",C2,"',",D2,",",E2,",",F2,");")


",D2,"代表D2单元格数据,如果单元格数据为字符串 需用''包裹,'",A2,"' 代表 'A2'; string类型

posted on 2023-08-16 16:56  dreamstar  阅读(918)  评论(0编辑  收藏  举报