You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
What did you do?
If possible, provide a recipe for reproducing the error.
SELECT ( SELECT GROUP_CONCAT( CONCAT( 123, '-' ) ) FROM user_info ui WHERE ui.id = read_cust_user_id GROUP BY ui.id ) AS levelCode FROM ods_order_item_base_two
Error information is :
1105 - subquery returns more than 1 row
Remarks:
read_cust_user_id is ods_order_item_base_two table field。
What did you expect to see?
Give an explanation.
What did you see instead? GROUP BY ui.id
Change to GROUP BY read_cust_user_id
Successful implementation
What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
Release Version: v2.1.1
Git Commit Hash: 990f859
Git Branch: release-2.1
UTC Build Time: 2018-12-12 10:57:44
GoVersion: go version go1.11.2 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
The text was updated successfully, but these errors were encountered:
Hi, @799983050 Thanks for your feedback.
The case you mentioned is weird.
I tried to build a simple case to reproduce it but failed.
May you provide us the table schema and data which can reproduce this problem?
@XuHuaiyu Hello, I created a model for you to find problems.
`
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE IF EXISTS t;
CREATE TABLE t ( id int(11) NOT NULL,
PRIMARY KEY (id) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 100 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
INSERT INTO t VALUES (508931);
INSERT INTO t VALUES (508932);
SET FOREIGN_KEY_CHECKS = 1;
`
`
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE IF EXISTS s;
CREATE TABLE s ( id int(11) NOT NULL, read_cust_user_id int(11) NOT NULL,
PRIMARY KEY (id) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 100 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
INSERT INTO s VALUES (100292, 508931);
INSERT INTO s VALUES (120002, 508932);
Bug Report
Please answer these questions before submitting your issue. Thanks!
If possible, provide a recipe for reproducing the error.
SELECT ( SELECT GROUP_CONCAT( CONCAT( 123, '-' ) ) FROM user_info ui WHERE ui.id = read_cust_user_id GROUP BY ui.id ) AS levelCode FROM ods_order_item_base_two
Error information is :
Give an explanation.
GROUP BY ui.id
Change to
GROUP BY read_cust_user_id
Successful implementation
tidb-server -V
or runselect tidb_version();
on TiDB)?Release Version: v2.1.1
Git Commit Hash: 990f859
Git Branch: release-2.1
UTC Build Time: 2018-12-12 10:57:44
GoVersion: go version go1.11.2 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
The text was updated successfully, but these errors were encountered: