You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/10/24 07:51:49 UTC

[GitHub] [shardingsphere] blppz opened a new issue #7906: SQL rewrite error, " SELECT COUNT(DISTINCT(order_serial)) counts ... " rewite to " SELECT DISTINCT order_serial count ... "

blppz opened a new issue #7906:
URL: https://github.com/apache/shardingsphere/issues/7906


   Hey my friends
   I use sharding-jdbc for springboot 4.1.0
   and i get this bug, logic sql is: 
   `SELECT COUNT(DISTINCT(order_serial)) counts
   FROM access_record
   WHERE enter_time BETWEEN ? AND ?`
   actual sql is:
   `SELECT DISTINCT order_serial counts
   FROM access_record_20201001
   WHERE enter_time BETWEEN ? AND ?`
   so, i got an wrong answer, I can avoid this problem, but I hope you can fix this bug, ths


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero commented on issue #7906: SQL rewrite error, " SELECT COUNT(DISTINCT(order_serial)) counts ... " rewite to " SELECT DISTINCT order_serial count ... "

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #7906:
URL: https://github.com/apache/shardingsphere/issues/7906#issuecomment-716470848


   Hi @blppz 
   Firstly, the actual SQL is expected, since ShardingSphere will calculate the `count()` by itself.
   As @avalon5666 said, we did not know what the concrete problem or exception is.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] avalon5666 edited a comment on issue #7906: SQL rewrite error, " SELECT COUNT(DISTINCT(order_serial)) counts ... " rewite to " SELECT DISTINCT order_serial count ... "

Posted by GitBox <gi...@apache.org>.
avalon5666 edited a comment on issue #7906:
URL: https://github.com/apache/shardingsphere/issues/7906#issuecomment-716304025


   Pls provide a complete exception stack.
   
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu closed issue #7906: SQL rewrite error, " SELECT COUNT(DISTINCT(order_serial)) counts ... " rewite to " SELECT DISTINCT order_serial count ... "

Posted by GitBox <gi...@apache.org>.
terrymanu closed issue #7906:
URL: https://github.com/apache/shardingsphere/issues/7906


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu commented on issue #7906: SQL rewrite error, " SELECT COUNT(DISTINCT(order_serial)) counts ... " rewite to " SELECT DISTINCT order_serial count ... "

Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #7906:
URL: https://github.com/apache/shardingsphere/issues/7906#issuecomment-723525980


   Closed because of no response anymore


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] avalon5666 commented on issue #7906: SQL rewrite error, " SELECT COUNT(DISTINCT(order_serial)) counts ... " rewite to " SELECT DISTINCT order_serial count ... "

Posted by GitBox <gi...@apache.org>.
avalon5666 commented on issue #7906:
URL: https://github.com/apache/shardingsphere/issues/7906#issuecomment-716304025


   The backend database is MySQL or PostgreSQL?


----------------------------------------------------------------
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:
users@infra.apache.org