解析语句的时候少 ' 符号我怎么做解析的时候才能把 ' 保留

qq_34188442 2016-07-21 10:13:39
select y,m,d,h, sid,channel,cointype,sum(spend) as num,count(distinct source) as cnt from(select sid,channel,year(ts)as y,month(ts)as m,day(ts)as d ,hour(ts)as h,cast(regexp_extract(param, ‘’{"sid":(.*?),"num":(.*?),("source":(.*?),)?("reason":(.*?),)?"cointype":(.*?),("status":(.*?),)?("petid":(.*?),)?"action":(.*?),("itemid":(.*?),)?("type":(.*?),)?"bid":(.*?)(,"spend":(.*?))?}'', 4) as bigint) as source,cast(regexp_extract(param, ''{"sid":(.*?),"num":(.*?),("source":(.*?),)?("reason":(.*?),)?"cointype":(.*?),("status":(.*?),)?("petid":(.*?),)?"action":(.*?),("itemid":(.*?),)?("type":(.*?),)?"bid":(.*?)(,"spend":(.*?))?}'', 2) as int) as num, cast(regexp_extract(param, ''{"sid":(.*?),"num":(.*?),("source":(.*?),)?("reason":(.*?),)?"cointype":(.*?),("status":(.*?),)?("petid":(.*?),)?"action":(.*?),("itemid":(.*?),)?("type":(.*?),)?"bid":(.*?)(,"spend":(.*?))?}'', 19) as int) as spend,cast(regexp_extract(param, ''{"sid":(.*?),"num":(.*?),("source":(.*?),)?("reason":(.*?),)?"cointype":(.*?),("status":(.*?),)?("petid":(.*?),)?"action":(.*?),("itemid":(.*?),)?("type":(.*?),)?"bid":(.*?)(,"spend":(.*?))?}'', 7) as int) as cointype from analytics where to_date(ts)="{0}" and action=1053 and param like '%"action":1%' and param like '%"cointype":1%') t group by y,m,d, sid,channel,h,cointype order by y,m,d, sid,channel,h,cointype
现在我在加上一个 ' 他就解析不了了,我不加吧是能解析出来关键是少了个 ' 去查数据的时候报错我该加什么才能保留这个 '
...全文
146 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

61,112

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧