excel快速批量拼接sql语句

="update lf_num set org_no='"&A2&"' where netid='"&C2&"';"

语法说明:
1.整个语句需要用""双引号引起来

2.具体的填充数据需要放在 单引号 加双引号及&地址符号的中间('"&&"')

3.最好用分号隔开,这样sql在执行器中运行的时候能够自动判断结束

二、sql拼接生成整数而非字符串,去掉单引号。
image

INSERT INTO time_state (year, month, time_slot_id, state_id) VALUES (2025, 1, 1, 5)和
INSERT INTO time_state (year, month, time_slot_id, state_id) VALUES (2025, 1,'1','5')的区别

posted @ 2023-02-14 17:34  shamozhicheng  阅读(707)  评论(0)    收藏  举报