找到有问题的报表活动

  1. 将多行合成一行且确保不自动添加空格
    使用notepad++的扩展替换
    \r\n - > ,

select concat(',',group_concat(`tab_offer`.`OFFER_ID` separator ','),',') AS `concat(",",GROUP_CONCAT(offer_id SEPARATOR ','),",")` from `tab_offer` where locate(`tab_offer`.`OFFER_NAME`,'波罗蜜日韩购01,波罗蜜日韩购_appstore,布武天下01,布武天下04,长生诀01,长生诀02,唱吧直播间01,穿越火线(首谷)01,穿越火线(JC)01,大武将(glispa)01_server,大武将03,大武将07,大武将10,大众点评idfa01,当当(星空秋雨)09,当当(JC)01,抖音视频(来福畅想)01,放置奇兵idfa01,蜂潮01,凤凰新闻01,钢琴块02,钢琴块05,钢琴块06,钢琴块09,高德地图(新)01,弓箭手03,弓箭手05,古龙群侠传(JC)01,瓜子二手车(直客),官升九品01,光荣使命(首谷)01,光荣使命(JC),光荣使命(snk)01,归离剑(乐牛)02,归离剑(掌握)idfa01_server,滚动的天空09,国美01,黑暗雄心01,黑暗雄心01_server,黑暗与魔法01,荒野行动01,皇室战争(JC)01,魂斗罗(首谷)01,魂之轨迹(新澜互动)01,火球买手01,火球买手09,火山小视频(来福畅想)01,火星直播01,火影忍者(首谷)01,剑与家园(双端)01,剑与家园(新线)01,剑与家园,叫我万岁爷01,叫我万岁爷02,叫我万岁爷03,今日头条(来福畅想)01,今日头条_appstore,京东金融01,玖富万卡15,玖富万卡16,玖富万卡19,九州天空城3D01,九州天空城3D03,九州天空城3D03_server,酷我音乐(新),酷我音乐(新)_sever,酷我音乐01,快马小报01,快马小报03_server,来伊份03,来伊份04,来伊份04_server,来伊份05,来伊份_appstore,老铁传奇01,荔枝FM01,灵剑传说01,乱世王者(SNK),乱世王者01,美团网01,梦幻仙游01,摩天轮票务(JC)01,魔域_server,陌陌(康远)04,陌陌(康远新)01,陌陌(康远新)02,陌陌(康远新)03,陌陌(康远新)04,陌陌01,陌陌02,陌陌03,陌陌_appstore,内涵段子(来福畅想)01,啪啪三国2(飞流)01,啪啪三国2(飞流)02,啪啪三国2(飞流)07,啪啪三国2(1),骑士保卫战01,热血剑尊01_server,三国如龙传01,三国志01,三国志2017_00,深海水族馆01,神武3idfa01,神武3idfa03_server,圣斗士星矢,什么值得买01,什么值得买02,什么值得买03_众安保险01,手机百度(智摩)01,天龙八部(新)SNK01,天使恶魔龙01,天使恶魔龙02,天使恶魔龙04,天使恶魔龙05,跳舞的线01,跳舞的线07,土豆视频(直客)12,土豆视频idfa01,王牌特工01,王者荣耀(JC)01,王者荣耀_appstore,问道01,我在大清当皇帝02,西瓜视频(来福畅想)01,仙剑修神录01,仙履情缘01,消灭星星01,小米超神02,小米超神03,小米超神04,小米超神04_server,携程01,携程01_server,妖精的尾巴01,妖精的尾巴01_server,野蛮时代idfa01,野蛮时代idfa01_server,野兽派01,英雄无敌_IOS_appstore,英雄无敌_TW_AND,英雄无敌_TW_IOS,优信二手车01,元气封神IP02,元气封神IP03,元气封神IP04,元气封神IP05,元气封神idfa01,元气封神idfa03,元气封神idfa04,元气封神idfa05,元气封神mobvista,战争与文明03,战争与文明03_server,终结者2_01,最强NBA(聚告)01,最强NBA(JC)01,Agoda_KR_IOS_01,AliExpress_US_IOS_01,Arrow.io,Dancing Line,Dancing Line_JP_AND_01,Dancing Line_JP_IOS_01,Dancing Line_KR_AND_01,Dancing Line_US_AND_01,DancingLine_KR_IOS_01,DancingLine_US_IOS_01,Flotten_Kommando_DE_AND_01,Flotten_Kommando_DE_IOS_01,Goodoc_KR_AND_01,LottoRich_KR_AND_01,NBA梦之队03,RollingSky_DE_AND,RollingSky_GB_IOS,RollingSky_JP_AND,RollingSky_JP_IOS,RollingSky_KR_AND,RollingSky_US_AND,RollingSky_US_IOS,Sinsaegae_TV_KR_AND_01,Tap Tap Dash,Tap Tap Dash_appstore,Tap Tap Fish,TapTapFish_JP_AND_01,TapTapFish_JP_IOS_01,TapTapFish_KR_AND_01,TapTapFish_KR_IOS_01,TapTapFish_US_AND_01,TapTapFish_US_IOS_01,wifi')
  1. 显示所有指定offer相关的价格记录
select * from tab_orecord where instr(@idstr:=(select * from GetOfferidsWhichCampHasNoOutPriceInReport),OFFER_ID)
  1. 统计offer_id重复的价格记录
select offer_id,count(*) as count from tab_orecord where instr(@idstr:=(select * from GetOfferidsWhichCampHasNoOutPriceInReport),OFFER_ID)  group by offer_id having count>1

你可能感兴趣的:(找到有问题的报表活动)