CREATE TABLE t1(c1 FLOAT(10,5) UNSIGNED NOT NULL, c2 FLOAT(10,5) SIGNED NULL, c3 FLOAT, c4 INT, UNIQUE INDEX idx(c1,c2)); INSERT INTO t1 VALUES('00100.05000','-00100.05000','00100.05000',1); INSERT INTO t1(c1) VALUES('12345.000009'); INSERT INTO t1 VALUES('99999.99999','-99999.99999','99999.99999',3); DELETE FROM t1 WHERE c1='100000.00000' AND c2='-100000.00000'; INSERT INTO t1 VALUES('100000.000002','-100000.000002','100000.000002',5); insert into t1 values ("0.0","0.0","0.0",7),("01.0","01.0","01.0",10); insert into t1 values ("-.1","-.1","-.1",13); insert into t1 values ("+111111111.11","+111111111.11","+111111111.11",19); --sorted_result SELECT * FROM t1; SELECT * FROM t1 WHERE c2 >= '-99999.99999' AND c2 < '0.0' AND c1 = '99999.99999' ORDER BY c1,c2; SELECT * FROM t1 WHERE c2 >= '-99999.99999' AND c2 < '0.0' AND c1 = '99999.99999' ORDER BY c1,c2 LIMIT 2; SELECT * FROM t1 WHERE c2 >= '-99999.99999' AND c2 < '0.0' AND c1 = '99999.99999' ORDER BY c1,c2 DESC; SELECT * FROM t1 WHERE c2 >= '-99999.99999' AND c2 < '0.0' AND c1 = '99999.99999' ORDER BY c1,c2 DESC LIMIT 2; DROP TABLE t1;