kimmking commented on issue #6658:
URL: https://github.com/apache/shardingsphere/issues/6658#issuecomment-680671377


   Case 1: 
shardingsphere-integration-test/shardingsphere-test-suite/src/test/resources/integrate/cases/dql/dataset/tbl/select_distinct_with_avg.xml
   
   The original sql
   ```
   SELECT AVG(DISTINCT order_id) FROM t_order WHERE order_id < 1100
   ```
   
   convert to:
   ```
   SELECT DISTINCT order_id AS AGGREGATION_DISTINCT_DERIVED_0 , order_id AS 
AVG_DERIVED_COUNT_0 , order_id AS AVG_DERIVED_SUM_0 FROM t_order_0 WHERE 
order_id < 1100
   SELECT DISTINCT order_id AS AGGREGATION_DISTINCT_DERIVED_1 , order_id AS 
AVG_DERIVED_COUNT_0 , order_id AS AVG_DERIVED_SUM_0 FROM t_order_0 WHERE 
order_id < 1100
   ```
   
   Rewriting result is wrong
   


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to