Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separator and order by not supported in group_concat #4059

Closed
jackysp opened this issue Aug 7, 2017 · 2 comments
Closed

Separator and order by not supported in group_concat #4059

jackysp opened this issue Aug 7, 2017 · 2 comments
Assignees
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/compatibility

Comments

@jackysp
Copy link
Member

jackysp commented Aug 7, 2017

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
create table t1 (grp int, a bigint unsigned, c char(10) not null, d char(10) not null);
insert into t1 values (1,1,"a","a"); 
insert into t1 values (2,2,"b","a"); 
insert into t1 values (2,3,"c","b");
insert into t1 values (3,4,"E","a");
insert into t1 values (3,5,"C","b");
select grp,group_concat(c separator ",") from t1 group by grp;    
select grp,group_concat(c order by c) from t1 group by grp; 
  1. What did you expect to see?
grp	group_concat(c separator ",")
1	a
2	b,c
3	E,C
grp	group_concat(c order by c)
1	a
2	b,c
3	C,E
  1. What did you see instead?
ERROR 1105 (HY000) at line 7: line 0 column 35 near " ",") from t1 group by grp" (total length 61)
  1. What version of TiDB are you using (tidb-server -V)?
@jackysp jackysp added type/compatibility help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. rc3.1 labels Aug 7, 2017
@zz-jason zz-jason self-assigned this Aug 7, 2017
@ngaut ngaut removed the rc3.1 label Aug 16, 2017
@morgo
Copy link
Contributor

morgo commented Nov 24, 2018

Separator is now supported, order by is parse but ignored:

tidb> select grp,group_concat(c separator "#") from t1 group by grp;    
+------+-------------------------------+
| grp  | group_concat(c separator "#") |
+------+-------------------------------+
|    1 | a                             |
|    3 | E#C                           |
|    2 | b#c                           |
+------+-------------------------------+
3 rows in set (0.01 sec)

tidb> select grp,group_concat(c order by c) from t1 group by grp; 
+------+----------------------------+
| grp  | group_concat(c order by c) |
+------+----------------------------+
|    1 | a                          |
|    3 | E,C                        |
|    2 | b,c                        |
+------+----------------------------+
3 rows in set (0.00 sec)

@morgo
Copy link
Contributor

morgo commented Nov 24, 2018

ORDER BY is a duplicate of #6838

I am going to close this issue now, as the new issue better describes the remaining scope.

@morgo morgo closed this as completed Nov 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/compatibility
Projects
None yet
Development

No branches or pull requests

4 participants