您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

sql太长的时候,在python执行会出现报错,可以用'''号来解决问题。

bubuko 2022/1/25 19:02:08 python 字数 5422 阅读 856 来源 http://www.bubuko.com/infolist-5-1.html

sql = '''select case left(d.name,2) when 'DD' then '*' when 'DW' then '*' when 'ZN' then '*' when 'DL' then '*' WHEN 'HB' then '华北' when 'ZH' then'*' ...
sql = ‘‘‘select
case left(d.name,2) when DD then * when DW then * when ZN then * when DL then * WHEN HB then 华北 when ZH then*  when DS then 大数据 when XS then * else 研发中心 end as 所属部门,
d.name as 项目,
b.realname,
 a.date,
 a.consumed as 工时,
 a.work
FROM zt_effort a
left join zt_user b on a.account=b.account
left join zt_dept c on b.dept=c.id
left join zt_project d on a.project=d.id
left join zt_task e on a.objectID=e.id
where c.id in (35,22,1)
and a.date >=20201226 and a.date <=20210625 and c.name=* and a.consumed>0
and b.realname  in (*)
and d.name not in  (*)
ORDER BY d.name,a.date‘‘‘

 

sql太长的时候,在python执行会出现报错,可以用'''号来解决问题。

原文:https://www.cnblogs.com/ruijie/p/14930635.html


如果您也喜欢它,动动您的小指点个赞吧

除非注明,文章均由 laddyq.com 整理发布,欢迎转载。

转载请注明:
链接:http://laddyq.com
来源:laddyq.com
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。


联系我
置顶