siriume commented on issue #14372: URL: https://github.com/apache/doris/issues/14372#issuecomment-1319975261
GROUP BY `date` --> mysql column name, doris now is column name HAVING `date` = "202201" --> mysql column name, doris now is alias ```sql SELECT date_format(date, '%x%v') AS `date`, count(date) AS `diff_days` FROM tb_holiday where `date` between 20220101 AND 20220106 GROUP BY `date` -- mysql column name, doris now is column name HAVING `date` = "202201" -- mysql column name, doris now is alias ORDER BY date; ``` if change sql like this: ```sql SELECT date_format(date, '%x%v') AS `_date`, count(date) AS `diff_days` FROM tb_my_holiday where `date` between 20220101 AND 20220106 GROUP BY _date HAVING `_date` = "202201" ORDER BY date; -- doris error: [HY000][1105] errCode = 2, detailMessage = ORDER BY expression not produced by aggregation output (missing from GROUP BY clause?): `date`, mysql execute success. ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
