【 TiDB 使用环境】生产环境
【 TiDB 版本】
【复现路径】做过哪些操作出现的问题
select base.I_DATE, -- uniq
base.CH_DEPT_NAME, -- uniq
ifnull(acci.I_FMS_COUNT, 0) as I_FMS_COUNT,
ifnull(comm.I_COMMENT_COUNT, 0) as I_COMMENT_COUNT,
ifnull(comm.I_USER_COUNT, 0) as I_USER_COUNT,
ifnull(comm.I_ENTER_COUNT, 0) as I_ENTER_COUNT、
from (select I_MONTH as I_DATE, CH_DEPT_NAME
from (select distinct I_MONTH from stat_date_info where I_DATE >= 20210301) a
join (select 'a组' as CH_DEPT_NAME
union
select 'b组' as CH_DEPT_NAME
union
select 'c组' as CH_DEPT_NAME
union
select 'd组' as CH_DEPT_NAME
union
select 'e组' as CH_DEPT_NAME
union
select '总计' as CH_DEPT_NAME) b) base
left join (select I_DATE, CH_DEPT_NAME, I_COMMENT_COUNT, I_USER_COUNT, I_ENTER_COUNT
from dws_biz_service_dept_comment_cnt_mdi
union select I_DATE,
'总计',
sum(I_COMMENT_COUNT) as I_COMMENT_COUNT,
sum(I_USER_COUNT) as I_USER_COUNT,
sum(I_ENTER_COUNT) as I_ENTER_COUNT
from dws_biz_service_dept_comment_cnt_mdi
group by I_DATE) comm on base.I_DATE = comm.I_DATE and base.CH_DEPT_NAME = comm.CH_DEPT_NAME
left join (select I_DATE, CH_DEPT_NAME, I_FMS_COUNT
from dws_biz_service_dept_accident_cnt_mdi
union
select I_DATE,
'总计',
sum(I_FMS_COUNT) as I_FMS_COUNT
from dws_biz_service_dept_accident_cnt_mdi
group by I_DATE) acci on base.I_DATE = acci.I_DATE and base.CH_DEPT_NAME = acci.CH_DEPT_NAME
表dws_biz_service_dept_accident_cnt_mdi COLLATE=utf8mb4_unicode_ci
表dws_biz_service_dept_comment_cnt_mdi COLLATE=utf8mb4_unicode_ci
【遇到的问题:问题现象及影响】
上面sql,使用go代码执行报错
Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_unicode_ci,IMPLICIT) for operation '='
【资源配置】
【附件:截图/日志/监控】