My table is as below:
create table testing(
bnum varchar(7)
);
and here is the values:
insert into testing values
('0547366'),
('0547367'),
('0547368'),
('0547369'),
('0547370'),
('0547371'),
('0547372'),
('0547373'),
('0547374'),
('0547375'),
('0547376');
I used the below query:
select group_concat(bnum) as nums from testing;
and getting the following result:
+============
nums
+============
0547366,0547367,0547368,0547369,0547370,0547371,0547372,0547373,0547374,0547375,0547376
+============
But I would like to have the following result where I need multiple sets of numbers where 3 numbers in each set separated by comma:
+============
nums
+============
0547366,0547367,0547368
+============
0547369,0547370,0547371
+============
0547372,0547373,0547374
+============
0547375,0547376
+============
How can I write this query?