starocean999 commented on issue #14372:
URL: https://github.com/apache/doris/issues/14372#issuecomment-1320165262

   > > Group by gives higher priority to column name than alias, but order by 
prefer alias. This is the same as mysql. Master branch has corrected this 
behavior recently.
   > 
   > query like this
   > 
   > ```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`
   > ORDER BY date;
   > ```
   > 
   > in 1.1.4-rc01, result like this
   > 
   > ```sql
   > 202152,2
   > 202201,4
   > ```
   > 
   > in master 
[f49a0da](https://github.com/apache/doris/commit/f49a0daf543d843297aeaa7571aaa27ebaf6d5cb),
 even before this commit.
   > 
   > ```sql
   > 202152,2
   > 202201,4
   > ```
   > 
   > in master 
[9de1fec](https://github.com/apache/doris/commit/9de1fec6cc21aa81d744955f8cd1dca2a1148a57)
   > 
   > ```sql
   > 202152,1
   > 202152,1
   > 202201,1
   > 202201,1
   > 202201,1
   > 202201,1
   > ```
   > 
   > if doris change this action in 1.2.0 stable release, Please confirm as 
soon as possible and reply to this issue, cause we need to modify a lot of code 
to avoid inconsistent results after the upgrade(1.2.0 stable).
   
   Sorry for the inconstent behavior between old version and 1.2.0. Master and 
1.2.0 have been modified to keep same behavior with mysql( having clause as you 
point out is not correct and to be fixed soon). I'm afraid you have to change 
the old sql to get the correct result in 1.2.0. Sorry for the inconvenience 
again.


-- 
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]

Reply via email to