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

   **### 请大佬帮忙看看哈 万分感谢**
   按照order_id进行查询,order_id是奇数的时候,只能查询出来奇数的t_order_item中的数据,反之偶数也只能查询出偶数数据
   弄到半夜5点也没有搞定,官网能不能多提供一些例子哈?
   
   我把代码已经上传到百度云了,GitHub上面传不上。。。。
   
   链接: https://pan.baidu.com/s/1DCXW14UtLdby6lI5ELLqzw?pwd=btch 提取码: btch 
   
   第三个例子,中的测试代码,根据order_id查询、分页查询的时候,子表的数据都是不准确的。。
   
   表结构如下:
   `
   SET FOREIGN_KEY_CHECKS=0;
   
   -- ----------------------------
   -- Table structure for t_order0
   -- ----------------------------
   DROP TABLE IF EXISTS `t_order0`;
   CREATE TABLE `t_order0` (
     `order_id` bigint NOT NULL COMMENT '主键ID',
     `add_time` date DEFAULT NULL COMMENT '入库时间',
     `user_id` bigint DEFAULT NULL COMMENT '用户ID',
     `order_no` varchar(100) DEFAULT NULL COMMENT '订单编号',
     PRIMARY KEY (`order_id`)
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci 
COMMENT='订单表';
   
   -- ----------------------------
   -- Table structure for t_order1
   -- ----------------------------
   DROP TABLE IF EXISTS `t_order1`;
   CREATE TABLE `t_order1` (
     `order_id` bigint NOT NULL COMMENT '主键ID',
     `add_time` date DEFAULT NULL COMMENT '入库时间',
     `user_id` bigint DEFAULT NULL COMMENT '用户ID',
     `order_no` varchar(100) DEFAULT NULL COMMENT '订单编号',
     PRIMARY KEY (`order_id`)
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci 
COMMENT='订单表';
   
   -- ----------------------------
   -- Table structure for t_order2
   -- ----------------------------
   DROP TABLE IF EXISTS `t_order2`;
   CREATE TABLE `t_order2` (
     `order_id` bigint NOT NULL COMMENT '主键ID',
     `add_time` date DEFAULT NULL COMMENT '入库时间',
     `user_id` bigint DEFAULT NULL COMMENT '用户ID',
     `order_no` varchar(100) DEFAULT NULL COMMENT '订单编号',
     PRIMARY KEY (`order_id`)
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci 
COMMENT='订单表';
   
   -- ----------------------------
   -- Table structure for t_order3
   -- ----------------------------
   DROP TABLE IF EXISTS `t_order3`;
   CREATE TABLE `t_order3` (
     `order_id` bigint NOT NULL COMMENT '主键ID',
     `add_time` date DEFAULT NULL COMMENT '入库时间',
     `user_id` bigint DEFAULT NULL COMMENT '用户ID',
     `order_no` varchar(100) DEFAULT NULL COMMENT '订单编号',
     PRIMARY KEY (`order_id`)
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci 
COMMENT='订单表';`


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