summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/maria/distinct.result
blob: 7963e7b72ffdb78c749fe1d7ec26aa87639cd3f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a INT, b INT) ENGINE=Aria;
INSERT t1 VALUES (3,2004),(2,2006),(1,2007),(3,2008),(2,2005),(2,2001);
SELECT GROUP_CONCAT(a) FROM t1 GROUP BY b;
GROUP_CONCAT(a)
2
3
2
2
1
3
SELECT DISTINCT GROUP_CONCAT(a) FROM t1 GROUP BY b;
GROUP_CONCAT(a)
2
3
1
DROP TABLE t1;
CREATE TABLE t1 (a INT, b VARCHAR(1)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (7,'q'),(2,NULL),(7,'g'),(6,'x');
SELECT DISTINCT MAX( a ) FROM t1 GROUP BY b ORDER BY MD5( b );
MAX( a )
2
7
6
DROP TABLE t1;