sql语句
有一个非常长的sql,用编辑器打开编写的时候太长了导致编写非常吃力,而且容易错乱,我想做的是把A,B,C三个变量赋值到sql中的字段中去
折叠多行后写法
解决方案如下:
可以通过()小括号将每一行的字符串整齐拼接,回车以后会自动将每行的字符串进行拼接,并且将每个需要传参的字段加上 %s,在括号结束之前在用%(变量名字,变量名字,变量名字)依次进行赋值。最终完美解决。
有一个非常长的sql,用编辑器打开编写的时候太长了导致编写非常吃力,而且容易错乱,我想做的是把A,B,C三个变量赋值到sql中的字段中去
解决方案如下:
可以通过()小括号将每一行的字符串整齐拼接,回车以后会自动将每行的字符串进行拼接,并且将每个需要传参的字段加上 %s,在括号结束之前在用%(变量名字,变量名字,变量名字)依次进行赋值。最终完美解决。
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M