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

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执行会出现报错,可以用'''号来解决问题。

上一篇:php-mysqli封装


下一篇:Oracle 数据库查看client的用户登录信息包括ip