⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 func_gconcat.result

📁 这是linux下运行的mysql软件包,可用于linux 下安装 php + mysql + apach 的网络配置
💻 RESULT
📖 第 1 页 / 共 2 页
字号:
1	1,2,3,4,5SELECT t1.id1, GROUP_CONCAT(t1.id2 ORDER BY t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1;id1	concat_id1	1,2,3,4,52	1,2,3SELECT t1.id1, GROUP_CONCAT(t1.id2 ORDER BY t1.id2 DESC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1;id1	concat_id1	5,4,3,2,12	3,2,1SELECT t1.id1, GROUP_CONCAT(t1.id2 ORDER BY 6-t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1;id1	concat_id1	5,4,3,2,12	3,2,1SELECT t1.id1, GROUP_CONCAT(t1.id2,6-t1.id2 ORDER BY 6-t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1;id1	concat_id1	51,42,33,24,152	33,24,15SELECT t1.id1, GROUP_CONCAT(t1.id2,6-t1.id2 ORDER BY 6-t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1;id1	concat_id1	51,42,33,24,152	33,24,15SELECT t1.id1, GROUP_CONCAT(t1.id2,"/",6-t1.id2 ORDER BY 1+0,6-t1.id2,t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1;id1	concat_id1	5/1,4/2,3/3,2/4,1/52	3/3,2/4,1/5drop table t1,t2;create table t1 (s1 char(10), s2 int not null);insert into t1 values ('a',2),('b',2),('c',1),('a',3),('b',4),('c',4);select distinct s1 from t1 order by s2,s1;s1cabselect group_concat(distinct s1) from t1;group_concat(distinct s1)a,b,cselect group_concat(distinct s1 order by s2) from t1 where s2 < 4;group_concat(distinct s1 order by s2)c,b,aselect group_concat(distinct s1 order by s2) from t1;group_concat(distinct s1 order by s2)c,b,a,cdrop table t1;create table t1 (a int, c int);insert into t1 values (1, 2), (2, 3), (2, 4), (3, 5);create table t2 (a int, c int);insert into t2 values (1, 5), (2, 4), (3, 3), (3,3);select group_concat(c) from t1;group_concat(c)2,3,4,5select group_concat(c order by (select c from t2 where t2.a=t1.a limit 1)) as grp from t1;grp5,4,3,2select group_concat(c order by (select mid(group_concat(c order by a),1,5) from t2 where t2.a=t1.a)) as grp from t1;grp5,4,3,2select group_concat(c order by (select mid(group_concat(c order by a),1,5) from t2 where t2.a=t1.a) desc) as grp from t1;grp2,4,3,5select t1.a, group_concat(c order by (select c from t2 where t2.a=t1.a limit 1)) as grp from t1 group by 1;a	grp1	22	4,33	5select t1.a, group_concat(c order by (select mid(group_concat(c order by a),1,5) from t2 where t2.a=t1.a)) as grp from t1 group by 1;a	grp1	22	4,33	5select t1.a, group_concat(c order by (select mid(group_concat(c order by a),1,5) from t2 where t2.a=t1.a) desc) as grp from t1 group by 1;a	grp1	22	4,33	5select a,c,(select group_concat(c order by a) from t2 where a=t1.a) as grp from t1 order by grp;a	c	grp3	5	3,32	3	42	4	41	2	5drop table t1,t2;CREATE TABLE t1 ( a int );CREATE TABLE t2 ( a int );INSERT INTO t1 VALUES (1), (2);INSERT INTO t2 VALUES (1), (2);SELECT GROUP_CONCAT(t1.a*t2.a ORDER BY t2.a) FROM t1, t2 GROUP BY t1.a;GROUP_CONCAT(t1.a*t2.a ORDER BY t2.a)1,22,4DROP TABLE t1, t2;CREATE TABLE t1 (a char(4));INSERT INTO t1 VALUES ('John'), ('Anna'), ('Bill');SELECT GROUP_CONCAT(a SEPARATOR '||') AS names FROM t1 HAVING names LIKE '%An%';namesJohn||Anna||BillSELECT GROUP_CONCAT(a SEPARATOR '###') AS names FROM t1 HAVING LEFT(names, 1) ='J';namesJohn###Anna###BillDROP TABLE t1;CREATE TABLE t1 ( a int, b TEXT );INSERT INTO t1 VALUES (1,'First Row'), (2,'Second Row');SELECT GROUP_CONCAT(b ORDER BY b) FROM t1 GROUP BY a;GROUP_CONCAT(b ORDER BY b)First RowSecond RowDROP TABLE t1;CREATE TABLE t1 (A_ID INT NOT NULL,A_DESC CHAR(3) NOT NULL,PRIMARY KEY (A_ID));INSERT INTO t1 VALUES (1,'ABC'), (2,'EFG'), (3,'HIJ');CREATE TABLE t2 (A_ID INT NOT NULL,B_DESC CHAR(3) NOT NULL,PRIMARY KEY (A_ID,B_DESC));INSERT INTO t2 VALUES (1,'A'),(1,'B'),(3,'F');SELECT t1.A_ID, GROUP_CONCAT(t2.B_DESC) AS B_DESC FROM t1 LEFT JOIN t2 ON t1.A_ID=t2.A_ID GROUP BY t1.A_ID ORDER BY t1.A_DESC;A_ID	B_DESC1	A,B2	NULL3	FDROP TABLE t1;DROP TABLE t2;create table t1 (a int, b text);insert into t1 values (1, 'bb'), (1, 'ccc'), (1, 'a'), (1, 'bb'), (1, 'ccc');insert into t1 values (2, 'BB'), (2, 'CCC'), (2, 'A'), (2, 'BB'), (2, 'CCC');select group_concat(b) from t1 group by a;group_concat(b)bb,ccc,a,bb,cccBB,CCC,A,BB,CCCselect group_concat(distinct b) from t1 group by a;group_concat(distinct b)bb,ccc,aBB,CCC,Aselect group_concat(b order by b) from t1 group by a;group_concat(b order by b)a,bb,bb,ccc,cccA,BB,BB,CCC,CCCselect group_concat(distinct b order by b) from t1 group by a;group_concat(distinct b order by b)a,bb,cccA,BB,CCCset local group_concat_max_len=4;select group_concat(b) from t1 group by a;group_concat(b)bb,cBB,CWarnings:Warning	1260	2 line(s) were cut by GROUP_CONCAT()select group_concat(distinct b) from t1 group by a;group_concat(distinct b)bb,cBB,CWarnings:Warning	1260	2 line(s) were cut by GROUP_CONCAT()select group_concat(b order by b) from t1 group by a;group_concat(b order by b)a,bbA,BBWarnings:Warning	1260	2 line(s) were cut by GROUP_CONCAT()select group_concat(distinct b order by b) from t1 group by a;group_concat(distinct b order by b)a,bbA,BBWarnings:Warning	1260	2 line(s) were cut by GROUP_CONCAT()insert into t1 values (1, concat(repeat('1', 300), '2')), (1, concat(repeat('1', 300), '2')), (1, concat(repeat('0', 300), '1')), (2, concat(repeat('1', 300), '2')), (2, concat(repeat('1', 300), '2')), (2, concat(repeat('0', 300), '1'));set local group_concat_max_len=1024;select group_concat(b) from t1 group by a;group_concat(b)bb,ccc,a,bb,ccc,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001BB,CCC,A,BB,CCC,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001select group_concat(distinct b) from t1 group by a;group_concat(distinct b)bb,ccc,a,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001BB,CCC,A,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001select group_concat(b order by b) from t1 group by a;group_concat(b order by b)0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,a,bb,bb,ccc,ccc0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,A,BB,BB,CCC,CCCselect group_concat(distinct b order by b) from t1 group by a;group_concat(distinct b order by b)0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,a,bb,ccc0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,A,BB,CCCset local group_concat_max_len=400;select group_concat(b) from t1 group by a;group_concat(b)bb,ccc,a,bb,ccc,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,1111111111111111111111111111111111111111111111111111111111111111111111111111111111BB,CCC,A,BB,CCC,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,1111111111111111111111111111111111111111111111111111111111111111111111111111111111Warnings:Warning	1260	2 line(s) were cut by GROUP_CONCAT()select group_concat(distinct b) from t1 group by a;group_concat(distinct b)bb,ccc,a,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000BB,CCC,A,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Warnings:Warning	1260	2 line(s) were cut by GROUP_CONCAT()select group_concat(b order by b) from t1 group by a;group_concat(b order by b)0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111Warnings:Warning	1260	2 line(s) were cut by GROUP_CONCAT()select group_concat(distinct b order by b) from t1 group by a;group_concat(distinct b order by b)0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111Warnings:Warning	1260	2 line(s) were cut by GROUP_CONCAT()drop table t1;create table t1 (a varchar(255) character set cp1250 collate cp1250_general_ci,b varchar(255) character set koi8r);insert into t1 values ('xxx','yyy');select collation(a) from t1;collation(a)cp1250_general_ciselect collation(group_concat(a)) from t1;collation(group_concat(a))cp1250_general_cicreate table t2 select group_concat(a) as a from t1;show create table t2;Table	Create Tablet2	CREATE TABLE `t2` (  `a` varchar(400) character set cp1250 default NULL) ENGINE=MyISAM DEFAULT CHARSET=latin1select collation(group_concat(a,_koi8r'test')) from t1;collation(group_concat(a,_koi8r'test'))cp1250_general_ciselect collation(group_concat(a,_koi8r 0xC1C2)) from t1;ERROR HY000: Illegal mix of collations (cp1250_general_ci,IMPLICIT) and (koi8r_general_ci,COERCIBLE) for operation 'group_concat'select collation(group_concat(a,b)) from t1;ERROR HY000: Illegal mix of collations (cp1250_general_ci,IMPLICIT) and (koi8r_general_ci,IMPLICIT) for operation 'group_concat'drop table t1;drop table t2;CREATE TABLE t1 (a CHAR(10) CHARACTER SET cp850);INSERT INTO t1 VALUES ('

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -