Current Path : /home/usr.opt/mysql57/mysql-test/suite/engines/funcs/t/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //home/usr.opt/mysql57/mysql-test/suite/engines/funcs/t/fu_aggregate_max_subquery.test |
--disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings CREATE TABLE t1(c1 VARCHAR(10), c2 VARCHAR(10), c3 TINYINT); INSERT INTO t1 VALUES ('a','b',0), ('a','b',1), ('a','b',2), ('a','b',3), ('a','b',4), ('a','b',5), ('a','b',6), ('a','b',7), ('a','b',8), ('a','b',9); SELECT c1,c2,c3 FROM t1 ORDER BY c3 DESC LIMIT 1; SELECT c1,MAX(c3) FROM t1 GROUP BY c1; SELECT c1,c2,c3 FROM t1 WHERE c3=(SELECT MAX(c3) FROM t1); SELECT c1,c2,c3 FROM t1 WHERE c3=(SELECT MAX(t11.c3) FROM t1 AS t11 WHERE t1.c1 = t11.c1); DROP TABLE t1; CREATE TABLE t1(c1 VARCHAR(10), c2 VARCHAR(10), c3 SMALLINT); INSERT INTO t1 VALUES ('a','b',0), ('a','b',1), ('a','b',2), ('a','b',3), ('a','b',4), ('a','b',5), ('a','b',6), ('a','b',7), ('a','b',8), ('a','b',9); SELECT c1,c2,c3 FROM t1 ORDER BY c3 DESC LIMIT 1; SELECT c1,MAX(c3) FROM t1 GROUP BY c1; SELECT c1,c2,c3 FROM t1 WHERE c3=(SELECT MAX(c3) FROM t1); SELECT c1,c2,c3 FROM t1 WHERE c3=(SELECT MAX(t11.c3) FROM t1 AS t11 WHERE t1.c1 = t11.c1); DROP TABLE t1; CREATE TABLE t1(c1 VARCHAR(10), c2 VARCHAR(10), c3 MEDIUMINT); INSERT INTO t1 VALUES ('a','b',0), ('a','b',1), ('a','b',2), ('a','b',3), ('a','b',4), ('a','b',5), ('a','b',6), ('a','b',7), ('a','b',8), ('a','b',9); SELECT c1,c2,c3 FROM t1 ORDER BY c3 DESC LIMIT 1; SELECT c1,MAX(c3) FROM t1 GROUP BY c1; SELECT c1,c2,c3 FROM t1 WHERE c3=(SELECT MAX(c3) FROM t1); SELECT c1,c2,c3 FROM t1 WHERE c3=(SELECT MAX(t11.c3) FROM t1 AS t11 WHERE t1.c1 = t11.c1); DROP TABLE t1; CREATE TABLE t1(c1 VARCHAR(10), c2 VARCHAR(10), c3 INT); INSERT INTO t1 VALUES ('a','b',0), ('a','b',1), ('a','b',2), ('a','b',3), ('a','b',4), ('a','b',5), ('a','b',6), ('a','b',7), ('a','b',8), ('a','b',9); SELECT c1,c2,c3 FROM t1 ORDER BY c3 DESC LIMIT 1; SELECT c1,MAX(c3) FROM t1 GROUP BY c1; SELECT c1,c2,c3 FROM t1 WHERE c3=(SELECT MAX(c3) FROM t1); SELECT c1,c2,c3 FROM t1 WHERE c3=(SELECT MAX(t11.c3) FROM t1 AS t11 WHERE t1.c1 = t11.c1); DROP TABLE t1; CREATE TABLE t1(c1 VARCHAR(10), c2 VARCHAR(10), c3 INTEGER); INSERT INTO t1 VALUES ('a','b',0), ('a','b',1), ('a','b',2), ('a','b',3), ('a','b',4), ('a','b',5), ('a','b',6), ('a','b',7), ('a','b',8), ('a','b',9); SELECT c1,c2,c3 FROM t1 ORDER BY c3 DESC LIMIT 1; SELECT c1,MAX(c3) FROM t1 GROUP BY c1; SELECT c1,c2,c3 FROM t1 WHERE c3=(SELECT MAX(c3) FROM t1); SELECT c1,c2,c3 FROM t1 WHERE c3=(SELECT MAX(t11.c3) FROM t1 AS t11 WHERE t1.c1 = t11.c1); DROP TABLE t1; CREATE TABLE t1(c1 VARCHAR(10), c2 VARCHAR(10), c3 BIGINT); INSERT INTO t1 VALUES ('a','b',0), ('a','b',1), ('a','b',2), ('a','b',3), ('a','b',4), ('a','b',5), ('a','b',6), ('a','b',7), ('a','b',8), ('a','b',9); SELECT c1,c2,c3 FROM t1 ORDER BY c3 DESC LIMIT 1; SELECT c1,MAX(c3) FROM t1 GROUP BY c1; SELECT c1,c2,c3 FROM t1 WHERE c3=(SELECT MAX(c3) FROM t1); SELECT c1,c2,c3 FROM t1 WHERE c3=(SELECT MAX(t11.c3) FROM t1 AS t11 WHERE t1.c1 = t11.c1); DROP TABLE t1;