xfzhaoGit opened a new issue, #15798:
URL: https://github.com/apache/shardingsphere/issues/15798

   ## Bug Report
   
   **For English only**, other languages will not accept.
   .org/document/current/en/overview).
   
   SELECT
   b.id,
   a.name,
   IFNULL(b.signTime, ''),
   date_str dateStr
   FROM
   user a
   LEFT JOIN (
   SELECT
   sum(sign_time) AS signTime,
   date_str,
   user_id,
   FROM
   user_sign_record <!— Slice table —>
   WHERE
   user_id = ?
   GROUP BY date_str
   ) b ON a.id = b.user_id
   ORDER BY a.name
   
   user:
   id | name
   ---|---
   1 | zhangsan
   2 | lisi
   
   user_sign_record
   id | user_id | sign_time| date_str
   ---|---|---|---
   1 | 1 | 1000|2022-03-04
   2 | 2 | 1000|2022-03-04
   
   user_sign_record2022
   id | user_id | sign_time| date_str
   ---|---|---|---
   1 | 1 | 500|2022-03-04
   2 | 2 | 500|2022-03-04
   
   `create_date`  is sharding key,  this sql is all tables scans.
   
   expectd:
   id | name |dateStr| signTime
   ---|---|---|---
   1 | zhangsan|2022-03-04 | 1500
   2 | lisi |2022-03-04| 1500
   
   actual:
   id | name | dateStr| signTime
   ---|---|---|---
   1 | zhangsan|2022-03-04 | 1000
   2 | lisi|2022-03-04 | 1000
   
   or
   
   id | name | dateStr| signTime
   ---|---|---|---
   1 | zhangsan|2022-03-04 | 500
   2 | lisi|2022-03-04 | 500
   
   ### Which version of ShardingSphere did you use?
   5.1.0
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC 
   
   


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

Reply via email to