StatementCallback; bad SQL grammar [-- 用户工号 W8012827/报表id 180677/取数id null/数据集id 8281/数据源id 953
SELECT
`voc_label2`
,
(count(IF(T.`new_cust_model`='realme 14 Pro+ 5G', T.`voc_label1`, null))/tb_nLMYphd78Oz2KQUp_1.`agg_custom_1`) AS 'nLMYphd78Oz2KQUp',(count(IF(T.`new_cust_model`='realme 15 Pro 5G', T.`voc_label1`, null))/tb_lKe8yW4gBQufDWcW_1.`agg_custom_1`) AS 'lKe8yW4gBQufDWcW'
FROM (select vocid, singleid, case when syscode=12 and sysname='CC' then 'GCSM' when code=17 and sysname='WCSM' then 'GCSM_IDN' else sysname end as data_source, feedback_channel, feedback_channel1, feedback_channel2, feedback_channel3, dayno, concat(YEAR(dayno),'-',WEEK(dayno)+1) as t_week, date_format(dayno,'%Y-%m') as t_month, calltime, area, theater_name, voc_province, voc_city, new_cust_model, original_model, voc_series, category_type, voc_brand, on_time, date(on_time) as ontime, on_time_day, voc_brands, category_types, voc_seriess, new_cust_models, original_models, title, user_content, translate_title, translate_text, voc_label_path, voc_label1, voc_label2, voc_label3, voc_label4, voc_label5, feedback, situations, source_label_path, voc_label_emotion_attribute, view_point, voc_label_emotion, new_sessionid, new_handle_result, new_solve, new_satisfaction, type, new_solution, serve_mode, order_stage, repair_complete_time, serve_orderno, fag_name, full_path_name, shop_name, url, escore, case when datalevel='1' then '原文' when datalevel='2' then '评论' when datalevel='3' then '转发' when datalevel='4' then '回复' else datalevel end as datalevel, comments, likes, shares, views, push_time, factor_other from voc.ads_voc_original_label_detail_all d where exists( select 1 from voc.t_voc_self_analysis_perms_new p where p.tenant_id='realme_voc' and p.valid=1 and array_contains(p.user_id,'W8012827') and p.business_type=d.business_type and p.theater=d.area and p.code=d.code ) and feedback_channel3 is not null and code in (3001,3002,3003,3004,3005,3006,3007,3008,3009,3010,3011,3012,3013,3014,3015,3016,3017,3018,3019,3020,3021,3022,3023,31,32,33,34,35,36,37,41,42,43,44,45,46,47,48) and isshow = 1) T
left join (select T.`voc_label2` as "voc_label2_0_fix" ,(tb_lKe8yW4gBQufDWcW_1.`agg_custom_1`) as 'agg_custom_1' from (select T.`voc_label2` from (select * from(select vocid, singleid, case when syscode=12 and sysname='CC' then 'GCSM' when code=17 and sysname='WCSM' then 'GCSM_IDN' else sysname end as data_source, feedback_channel, feedback_channel1, feedback_channel2, feedback_channel3, dayno, concat(YEAR(dayno),'-',WEEK(dayno)+1) as t_week, date_format(dayno,'%Y-%m') as t_month, calltime, area, theater_name, voc_province, voc_city, new_cust_model, original_model, voc_series, category_type, voc_brand, on_time, date(on_time) as ontime, on_time_day, voc_brands, category_types, voc_seriess, new_cust_models, original_models, title, user_content, translate_title, translate_text, voc_label_path, voc_label1, voc_label2, voc_label3, voc_label4, voc_label5, feedback, situations, source_label_path, voc_label_emotion_attribute, view_point, voc_label_emotion, new_sessionid, new_handle_result, new_solve, new_satisfaction, type, new_solution, serve_mode, order_stage, repair_complete_time, serve_orderno, fag_name, full_path_name, shop_name, url, escore, case when datalevel='1' then '原文' when datalevel='2' then '评论' when datalevel='3' then '转发' when datalevel='4' then '回复' else datalevel end as datalevel, comments, likes, shares, views, push_time, factor_other from voc.ads_voc_original_label_detail_all d where exists( select 1 from voc.t_voc_self_analysis_perms_new p where p.tenant_id='realme_voc' and p.valid=1 and array_contains(p.user_id,'W8012827') and p.business_type=d.business_type and p.theater=d.area and p.code=d.code ) and feedback_channel3 is not null and code in (3001,3002,3003,3004,3005,3006,3007,3008,3009,3010,3011,3012,3013,3014,3015,3016,3017,3018,3019,3020,3021,3022,3023,31,32,33,34,35,36,37,41,42,43,44,45,46,47,48) and isshow = 1) T WHERE (`feedback_channel1` in ('退维修')) AND (`theater_name` in ('印度')) AND `on_time_day` >= 0 AND `on_time_day` <= 30) T group by T.`voc_label2` ) T cross join (select COUNT(IF(T.`new_cust_model`='realme 15 Pro 5G', T.`voc_label1`, null)) as "agg_custom_1" from (select vocid, singleid, case when syscode=12 and sysname='CC' then 'GCSM' when code=17 and sysname='WCSM' then 'GCSM_IDN' else sysname end as data_source, feedback_channel, feedback_channel1, feedback_channel2, feedback_channel3, dayno, concat(YEAR(dayno),'-',WEEK(dayno)+1) as t_week, date_format(dayno,'%Y-%m') as t_month, calltime, area, theater_name, voc_province, voc_city, new_cust_model, original_model, voc_series, category_type, voc_brand, on_time, date(on_time) as ontime, on_time_day, voc_brands, category_types, voc_seriess, new_cust_models, original_models, title, user_content, translate_title, translate_text, voc_label_path, voc_label1, voc_label2, voc_label3, voc_label4, voc_label5, feedback, situations, source_label_path, voc_label_emotion_attribute, view_point, voc_label_emotion, new_sessionid, new_handle_result, new_solve, new_satisfaction, type, new_solution, serve_mode, order_stage, repair_complete_time, serve_orderno, fag_name, full_path_name, shop_name, url, escore, case when datalevel='1' then '原文' when datalevel='2' then '评论' when datalevel='3' then '转发' when datalevel='4' then '回复' else datalevel end as datalevel, comments, likes, shares, views, push_time, factor_other from voc.ads_voc_original_label_detail_all d where exists( select 1 from voc.t_voc_self_analysis_perms_new p where p.tenant_id='realme_voc' and p.valid=1 and array_contains(p.user_id,'W8012827') and p.business_type=d.business_type and p.theater=d.area and p.code=d.code ) and feedback_channel3 is not null and code in (3001,3002,3003,3004,3005,3006,3007,3008,3009,3010,3011,3012,3013,3014,3015,3016,3017,3018,3019,3020,3021,3022,3023,31,32,33,34,35,36,37,41,42,43,44,45,46,47,48) and isshow = 1) T WHERE (`feedback_channel1` in ('退维修')) AND (`theater_name` in ('印度')) AND `on_time_day` >= 0 AND `on_time_day` <= 30 ) tb_lKe8yW4gBQufDWcW_1 group by T.`voc_label2` ) tb_lKe8yW4gBQufDWcW_1 on T.`voc_label2`=tb_lKe8yW4gBQufDWcW_1.`voc_label2_0_fix` left join (select T.`voc_label2` as "voc_label2_0_fix" ,(tb_nLMYphd78Oz2KQUp_1.`agg_custom_1`) as 'agg_custom_1' from (select T.`voc_label2` from (select * from(select vocid, singleid, case when syscode=12 and sysname='CC' then 'GCSM' when code=17 and sysname='WCSM' then 'GCSM_IDN' else sysname end as data_source, feedback_channel, feedback_channel1, feedback_channel2, feedback_channel3, dayno, concat(YEAR(dayno),'-',WEEK(dayno)+1) as t_week, date_format(dayno,'%Y-%m') as t_month, calltime, area, theater_name, voc_province, voc_city, new_cust_model, original_model, voc_series, category_type, voc_brand, on_time, date(on_time) as ontime, on_time_day, voc_brands, category_types, voc_seriess, new_cust_models, original_models, title, user_content, translate_title, translate_text, voc_label_path, voc_label1, voc_label2, voc_label3, voc_label4, voc_label5, feedback, situations, source_label_path, voc_label_emotion_attribute, view_point, voc_label_emotion, new_sessionid, new_handle_result, new_solve, new_satisfaction, type, new_solution, serve_mode, order_stage, repair_complete_time, serve_orderno, fag_name, full_path_name, shop_name, url, escore, case when datalevel='1' then '原文' when datalevel='2' then '评论' when datalevel='3' then '转发' when datalevel='4' then '回复' else datalevel end as datalevel, comments, likes, shares, views, push_time, factor_other from voc.ads_voc_original_label_detail_all d where exists( select 1 from voc.t_voc_self_analysis_perms_new p where p.tenant_id='realme_voc' and p.valid=1 and array_contains(p.user_id,'W8012827') and p.business_type=d.business_type and p.theater=d.area and p.code=d.code ) and feedback_channel3 is not null and code in (3001,3002,3003,3004,3005,3006,3007,3008,3009,3010,3011,3012,3013,3014,3015,3016,3017,3018,3019,3020,3021,3022,3023,31,32,33,34,35,36,37,41,42,43,44,45,46,47,48) and isshow = 1) T WHERE (`feedback_channel1` in ('退维修')) AND (`theater_name` in ('印度')) AND `on_time_day` >= 0 AND `on_time_day` <= 30) T group by T.`voc_label2` ) T cross join (select COUNT(IF(T.`new_cust_model`='realme 14 Pro+ 5G', T.`voc_label1`, null)) as "agg_custom_1" from (select vocid, singleid, case when syscode=12 and sysname='CC' then 'GCSM' when code=17 and sysname='WCSM' then 'GCSM_IDN' else sysname end as data_source, feedback_channel, feedback_channel1, feedback_channel2, feedback_channel3, dayno, concat(YEAR(dayno),'-',WEEK(dayno)+1) as t_week, date_format(dayno,'%Y-%m') as t_month, calltime, area, theater_name, voc_province, voc_city, new_cust_model, original_model, voc_series, category_type, voc_brand, on_time, date(on_time) as ontime, on_time_day, voc_brands, category_types, voc_seriess, new_cust_models, original_models, title, user_content, translate_title, translate_text, voc_label_path, voc_label1, voc_label2, voc_label3, voc_label4, voc_label5, feedback, situations, source_label_path, voc_label_emotion_attribute, view_point, voc_label_emotion, new_sessionid, new_handle_result, new_solve, new_satisfaction, type, new_solution, serve_mode, order_stage, repair_complete_time, serve_orderno, fag_name, full_path_name, shop_name, url, escore, case when datalevel='1' then '原文' when datalevel='2' then '评论' when datalevel='3' then '转发' when datalevel='4' then '回复' else datalevel end as datalevel, comments, likes, shares, views, push_time, factor_other from voc.ads_voc_original_label_detail_all d where exists( select 1 from voc.t_voc_self_analysis_perms_new p where p.tenant_id='realme_voc' and p.valid=1 and array_contains(p.user_id,'W8012827') and p.business_type=d.business_type and p.theater=d.area and p.code=d.code ) and feedback_channel3 is not null and code in (3001,3002,3003,3004,3005,3006,3007,3008,3009,3010,3011,3012,3013,3014,3015,3016,3017,3018,3019,3020,3021,3022,3023,31,32,33,34,35,36,37,41,42,43,44,45,46,47,48) and isshow = 1) T WHERE (`feedback_channel1` in ('退维修')) AND (`theater_name` in ('印度')) AND `on_time_day` >= 0 AND `on_time_day` <= 30 ) tb_nLMYphd78Oz2KQUp_1 group by T.`voc_label2` ) tb_nLMYphd78Oz2KQUp_1 on T.`voc_label2`=tb_nLMYphd78Oz2KQUp_1.`voc_label2_0_fix`
WHERE
(`feedback_channel1` in ('退维修')) AND (`theater_name` in ('印度')) AND `on_time_day` >= 0 AND `on_time_day` <= 30
GROUP BY `voc_label2`
ORDER BY `voc_label2` asc
LIMIT 0,3000]; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: '`tb_lKe8yW4gBQufDWcW_1`.`agg_custom_1`' must be an aggregate expression or appear in GROUP BY clause 这个报错的原因是什么?
最新发布