select git_mr.I_MR_ID
from table1 join table2 on table1.I_MR_ID = table2.I_MR_ID
where
1=1
and table2.D_UPDATED_AT >= '2023-06-01' and table2.D_UPDATED_AT <= '2023-06-11'
and table1.CH_USER_NAME != table2.CH_OPEN_USER_NAME
and CH_NOTE_TYPE="statsxxx"
and CH_USER_NAME not in ('aaa', 'bbbb.fe')
and CH_NOTE like 'cccc' -- 去掉此条件后,查询结果一致。
and CH_STATE = "xxxxx"
and table2.CH_GROUP NOT LIKE "%.%"
group by table2.I_MR_ID;