【 TiDB 使用环境】生产环境
【 TiDB 版本】TiDB6.1
【复现路径】
sql1: 此sql执行会报错:
> 1105 - Can't find column Column#57 in schema Column: [pre_dim.dim_performance_roster_month.role_id,pre_dim.dim_performance_roster_month.role_name,pre_dim.dim_performance_roster_month.role_id,pre_dim.dim_performance_roster_month.role_name] Unique key: []
SELECT
GROUP_CONCAT(DISTINCT `role_id` ORDER BY `role_id` ASC SEPARATOR '&&' ) role_ids,
GROUP_CONCAT(DISTINCT `role_name` ORDER BY `role_id` ASC SEPARATOR '&&' ) role_names
FROM(
SELECT
COALESCE(b.role_id,a.role_id) role_id
,COALESCE(b.role_name,a.role_name) role_name
FROM pre_dim.`dim_performance_roster_month` a
LEFT JOIN pre_dim.`dim_performance_roster_month` b ON a.user_id = b.user_id
) a1
sql2: 此sql执行(删去了order by …)没问题,无报错
SELECT
GROUP_CONCAT(DISTINCT `role_id` ) role_ids,
GROUP_CONCAT(DISTINCT `role_name` ) role_names
FROM(
SELECT
COALESCE(b.role_id,a.role_id) role_id
,COALESCE(b.role_name,a.role_name) role_name
FROM pre_dim.`dim_performance_roster_month` a
LEFT JOIN pre_dim.`dim_performance_roster_month` b ON a.user_id = b.user_id
) a1
sql3: 把子查询放入一个表中(test.test_dim_performance_roster_month),再去查,没问题
SELECT
GROUP_CONCAT(DISTINCT `role_id` ORDER BY `role_id` ASC SEPARATOR '&&' ) role_ids,
GROUP_CONCAT(DISTINCT `role_name` ORDER BY `role_id` ASC SEPARATOR '&&' ) role_names
FROM(
SELECT * from test.test_dim_performance_roster_month
) a1
【遇到的问题:问题现象及影响】
【资源配置】
【附件:截图/日志/监控】