代码改变世界

Excel生成sql脚本

2012-11-10 18:01  youxin  阅读(450)  评论(0编辑  收藏  举报

使用concatenate:


CONCATENATE( text1, text2, ... text_n )
text1 to text_n are the strings that you wish to join together.

via:http://www.techonthenet.com/excel/formulas/concat.php

命令如下:

="insert into table_name(col1,col2) values('"&A2&"','"&B2&"');"

会生成一条sql语句,往下拉就会连续生成。

上面的&表示连接两个字符串,还可以用concatenate来做。

http://gubaojian.blog.163.com/blog/static/1661799082012213053694/

http://wangxiao5530.iteye.com/blog/1630604

 

枚举类型

 

excel

vlaue(x)将x提取成数字

或者相乘

=IF(A4*1>0,"a","b")