CREATE TABLE t2(c1 TINYINT UNSIGNED NOT NULL, c2 TINYINT NULL, c3 SMALLINT, c4 MEDIUMINT , c5 INT, c6 INTEGER, c7 BIGINT, PRIMARY KEY(c1,c6)); INSERT INTO t2 VALUES(101,-102,103,104,105,106,107),(108,-109,110,111,112,113,114),(115,-116,117,118,119,120,121),(122,-123,124,125,126,127,128); INSERT INTO t2 VALUES(108,-109,110,111,112,101,114),(108,-109,110,111,112,102,114),(102,-109,110,111,112,113,114),(103,-109,110,111,112,113,114); INSERT INTO t2 VALUES(105,NULL,102,103,104,105,106); INSERT INTO t2 VALUES('','',17,18,19,20,21); INSERT INTO t2 VALUES(-1,124,22,23,24,25,26); INSERT INTO t2 VALUES(0,124,27,28,29,30,31); INSERT INTO t2 VALUES(0,0,32,32,34,35,36); INSERT INTO t2 VALUES('101.34 a','a',37,38,39,40,41); SELECT * FROM t2 WHERE c1 >= 0 AND c1 < 115 AND c6 = 113 ORDER BY c1,c6; SELECT * FROM t2 WHERE c1 >= 0 AND c1 < 115 AND c6 = 113 ORDER BY c1,c6 LIMIT 2; CREATE TABLE t3(c1 TINYINT UNSIGNED NOT NULL, c2 TINYINT NULL, c3 SMALLINT, c4 MEDIUMINT , c5 INT, c6 INTEGER, c7 BIGINT, index idx(c2,c7)); INSERT INTO t3 VALUES(101,-102,103,104,105,106,107),(108,-109,110,111,112,113,114),(115,-116,117,118,119,120,121),(122,-123,124,125,126,127,128); INSERT INTO t3 VALUES(101,-102,103,104,105,106,101),(101,-102,103,104,105,106,102),(101,-103,103,104,105,106,107),(101,-104,103,104,105,106,107); INSERT INTO t3 VALUES(105,NULL,102,103,104,105,106); INSERT INTO t3 VALUES('','',17,18,19,20,21); INSERT INTO t3 VALUES(-1,124,22,23,24,25,26); INSERT INTO t3 VALUES('101.34 a','a',37,38,39,40,41); SELECT * FROM t3 WHERE c2 >= -123 AND c2 < 0 AND c7 = 121 ORDER BY c2,c7; SELECT * FROM t3 WHERE c2 >= -123 AND c2 < 0 AND c7 = 121 ORDER BY c2,c7 LIMIT 2; drop table t2,t3;