python批量生成SQL语句
时间:2021-07-01 10:21:17
帮助过:7人阅读
guest.txt‘,
‘w‘)
for i
in range(1,100
):
str_i =
str(i)
realname =
‘jack‘ +
str_i
phone = 1380090911 +
i
email =
"jack" + str_i +
"@mail.com"
sql =
‘INSERT INTO sign_guest(realname,phone,sign,event_id) values ("‘+realname+
‘",‘+str(phone)+
‘,"‘+email+
‘",0,1);‘
f.write(sql)
f.write("\n")
f.close()
3,将生成的语句粘贴到mysql客户端执行
4,按照此思路可以进行其他语句的批量执行。
python批量生成SQL语句
标签:real 执行 sql语句 _id pytho for 其他 close phone