DROP TABLE IF EXISTS t1;
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;
c1	c2	c3
a	b	9
SELECT c1,MAX(c3) FROM t1 GROUP BY c1;
c1	MAX(c3)
a	9
SELECT c1,c2,c3 FROM t1 WHERE c3=(SELECT MAX(c3) FROM t1);
c1	c2	c3
a	b	9
SELECT c1,c2,c3 FROM t1 WHERE c3=(SELECT MAX(t11.c3) FROM t1 AS t11 WHERE t1.c1 = t11.c1);
c1	c2	c3
a	b	9
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;
c1	c2	c3
a	b	9
SELECT c1,MAX(c3) FROM t1 GROUP BY c1;
c1	MAX(c3)
a	9
SELECT c1,c2,c3 FROM t1 WHERE c3=(SELECT MAX(c3) FROM t1);
c1	c2	c3
a	b	9
SELECT c1,c2,c3 FROM t1 WHERE c3=(SELECT MAX(t11.c3) FROM t1 AS t11 WHERE t1.c1 = t11.c1);
c1	c2	c3
a	b	9
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;
c1	c2	c3
a	b	9
SELECT c1,MAX(c3) FROM t1 GROUP BY c1;
c1	MAX(c3)
a	9
SELECT c1,c2,c3 FROM t1 WHERE c3=(SELECT MAX(c3) FROM t1);
c1	c2	c3
a	b	9
SELECT c1,c2,c3 FROM t1 WHERE c3=(SELECT MAX(t11.c3) FROM t1 AS t11 WHERE t1.c1 = t11.c1);
c1	c2	c3
a	b	9
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;
c1	c2	c3
a	b	9
SELECT c1,MAX(c3) FROM t1 GROUP BY c1;
c1	MAX(c3)
a	9
SELECT c1,c2,c3 FROM t1 WHERE c3=(SELECT MAX(c3) FROM t1);
c1	c2	c3
a	b	9
SELECT c1,c2,c3 FROM t1 WHERE c3=(SELECT MAX(t11.c3) FROM t1 AS t11 WHERE t1.c1 = t11.c1);
c1	c2	c3
a	b	9
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;
c1	c2	c3
a	b	9
SELECT c1,MAX(c3) FROM t1 GROUP BY c1;
c1	MAX(c3)
a	9
SELECT c1,c2,c3 FROM t1 WHERE c3=(SELECT MAX(c3) FROM t1);
c1	c2	c3
a	b	9
SELECT c1,c2,c3 FROM t1 WHERE c3=(SELECT MAX(t11.c3) FROM t1 AS t11 WHERE t1.c1 = t11.c1);
c1	c2	c3
a	b	9
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;
c1	c2	c3
a	b	9
SELECT c1,MAX(c3) FROM t1 GROUP BY c1;
c1	MAX(c3)
a	9
SELECT c1,c2,c3 FROM t1 WHERE c3=(SELECT MAX(c3) FROM t1);
c1	c2	c3
a	b	9
SELECT c1,c2,c3 FROM t1 WHERE c3=(SELECT MAX(t11.c3) FROM t1 AS t11 WHERE t1.c1 = t11.c1);
c1	c2	c3
a	b	9
DROP TABLE t1;
