Current Path : /home/usr.opt/mysql57/mysql-test/suite/engines/iuds/r/ |
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/iuds/r/insert_calendar.result |
DROP TABLE IF EXISTS t1,t2,t3; CREATE TABLE t1(c1 DATE NOT NULL, c2 DATE NULL, c3 DATETIME, c4 TIMESTAMP, PRIMARY KEY(c1), UNIQUE INDEX(c2)); CREATE TABLE t2(c1 DATE NOT NULL, c2 DATE NULL, c3 DATETIME, c4 TIMESTAMP, PRIMARY KEY(c1,c2)); CREATE TABLE t3(c1 DATE NOT NULL, c2 DATE NULL, c3 DATETIME, c4 TIMESTAMP, UNIQUE INDEX idx(c1,c2)); CREATE TABLE t4(c1 DATE NOT NULL, c2 DATE NULL, c3 DATETIME, c4 TIMESTAMP); INSERT INTO t1 VALUES('98-12-31 11:30:45','98.12.31 11+30+45','98-12-31 11:30:45','98.12.31 11+30+45'),('98/12/30 11*30*45','98@12@30 11^30^45','98/12/30 11*30*45','98@12@30 11^30^45'),('98-12-29','98.12.29','98-12-29','98.12.29'),('98/12/28','98@12@28','98/12/28','98@12@28'); Warnings: Note 1265 Data truncated for column 'c1' at row 1 Note 1265 Data truncated for column 'c2' at row 1 Note 1265 Data truncated for column 'c1' at row 2 Note 1265 Data truncated for column 'c2' at row 2 INSERT INTO t2 VALUES('98-12-31 11:30:45','98.12.31 11+30+45','98-12-31 11:30:45','98.12.31 11+30+45'),('98/12/30 11*30*45','98@12@30 11^30^45','98/12/30 11*30*45','98@12@30 11^30^45'),('98-12-29','98.12.29','98-12-29','98.12.29'),('98/12/28','98@12@28','98/12/28','98@12@28'); Warnings: Note 1265 Data truncated for column 'c1' at row 1 Note 1265 Data truncated for column 'c2' at row 1 Note 1265 Data truncated for column 'c1' at row 2 Note 1265 Data truncated for column 'c2' at row 2 INSERT INTO t3 VALUES('98-12-31 11:30:45','98.12.31 11+30+45','98-12-31 11:30:45','98.12.31 11+30+45'),('98/12/30 11*30*45','98@12@30 11^30^45','98/12/30 11*30*45','98@12@30 11^30^45'),('98-12-29','98.12.29','98-12-29','98.12.29'),('98/12/28','98@12@28','98/12/28','98@12@28'); Warnings: Note 1265 Data truncated for column 'c1' at row 1 Note 1265 Data truncated for column 'c2' at row 1 Note 1265 Data truncated for column 'c1' at row 2 Note 1265 Data truncated for column 'c2' at row 2 INSERT INTO t4 VALUES('98-12-31 11:30:45','98.12.31 11+30+45','98-12-31 11:30:45','98.12.31 11+30+45'),('98/12/30 11*30*45','98@12@30 11^30^45','98/12/30 11*30*45','98@12@30 11^30^45'),('98-12-29','98.12.29','98-12-29','98.12.29'),('98/12/28','98@12@28','98/12/28','98@12@28'); Warnings: Note 1265 Data truncated for column 'c1' at row 1 Note 1265 Data truncated for column 'c2' at row 1 Note 1265 Data truncated for column 'c1' at row 2 Note 1265 Data truncated for column 'c2' at row 2 INSERT INTO t1 VALUES('20070523091528','070523091528','20070524091528','070524091528'),('20070525','070525','20070526','070526'); Warnings: Note 1265 Data truncated for column 'c1' at row 1 Note 1265 Data truncated for column 'c2' at row 1 INSERT INTO t2 VALUES('20070523091528','070523091528','20070524091528','070524091528'),('20070525','070525','20070526','070526'); Warnings: Note 1265 Data truncated for column 'c1' at row 1 Note 1265 Data truncated for column 'c2' at row 1 INSERT INTO t3 VALUES('20070523091528','070523091528','20070524091528','070524091528'),('20070525','070525','20070526','070526'); Warnings: Note 1265 Data truncated for column 'c1' at row 1 Note 1265 Data truncated for column 'c2' at row 1 INSERT INTO t4 VALUES('20070523091528','070523091528','20070524091528','070524091528'),('20070525','070525','20070526','070526'); Warnings: Note 1265 Data truncated for column 'c1' at row 1 Note 1265 Data truncated for column 'c2' at row 1 INSERT INTO t1 VALUES(19830905132800,830905132800,19830906132800,830906132800),(19830907,830907,19830908,830908); Warnings: Note 1265 Data truncated for column 'c1' at row 1 Note 1265 Data truncated for column 'c2' at row 1 INSERT INTO t2 VALUES(19830905132800,830905132800,19830906132800,830906132800),(19830907,830907,19830908,830908); Warnings: Note 1265 Data truncated for column 'c1' at row 1 Note 1265 Data truncated for column 'c2' at row 1 INSERT INTO t3 VALUES(19830905132800,830905132800,19830906132800,830906132800),(19830907,830907,19830908,830908); Warnings: Note 1265 Data truncated for column 'c1' at row 1 Note 1265 Data truncated for column 'c2' at row 1 INSERT INTO t4 VALUES(19830905132800,830905132800,19830906132800,830906132800),(19830907,830907,19830908,830908); Warnings: Note 1265 Data truncated for column 'c1' at row 1 Note 1265 Data truncated for column 'c2' at row 1 SET TIMESTAMP=1233216687; INSERT INTO t1 VALUES(NOW(),CURRENT_DATE,NOW(),CURRENT_DATE); Warnings: Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t2 VALUES(NOW(),CURRENT_DATE,NOW(),CURRENT_DATE); Warnings: Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t3 VALUES(NOW(),CURRENT_DATE,NOW(),CURRENT_DATE); Warnings: Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t4 VALUES(NOW(),CURRENT_DATE,NOW(),CURRENT_DATE); Warnings: Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t2 VALUES('98-12-31 11:30:45','98@12@30 11^30^45','98-12-31 11:30:45','98.12.31 11+30+45'),('98-12-29','98@12@30 11^30^45','98/12/30 11*30*45','98@12@30 11^30^45'); Warnings: Note 1265 Data truncated for column 'c1' at row 1 Note 1265 Data truncated for column 'c2' at row 1 Note 1265 Data truncated for column 'c2' at row 2 INSERT INTO t3 VALUES('98-12-31 11:30:45','98@12@30 11^30^45','98-12-31 11:30:45','98.12.31 11+30+45'),('98-12-29','98@12@30 11^30^45','98/12/30 11*30*45','98@12@30 11^30^45'); Warnings: Note 1265 Data truncated for column 'c1' at row 1 Note 1265 Data truncated for column 'c2' at row 1 Note 1265 Data truncated for column 'c2' at row 2 INSERT INTO t1 VALUES('2008-01-01',NULL,'08-01-02','08/01/03'); INSERT INTO t3 VALUES('2008-01-01',NULL,'08-01-02','08/01/03'); INSERT INTO t4 VALUES('2008-01-01',NULL,'08-01-02','08/01/03'); INSERT INTO t1(c1,c2) VALUES('08/01/17',NULL); DELETE FROM t1 WHERE c1='08/01/17' AND c2 IS NULL; INSERT INTO t1 VALUES('','','08-01-04','08/01/05') /* Inserts zero dates for '' strings */; Warnings: Warning 1265 Data truncated for column 'c1' at row 1 Warning 1265 Data truncated for column 'c2' at row 1 INSERT INTO t2 VALUES('2008-04-31','2008-04-31','08-01-06','08/01/07') /* Inserts zero dates for invalid dates */; Warnings: Warning 1265 Data truncated for column 'c1' at row 1 Warning 1265 Data truncated for column 'c2' at row 1 INSERT INTO t3 VALUES('10:45:15','10:45:15','08-01-08','08/1/9') /* Inserts zero dates for invalid dates */; Warnings: Warning 1265 Data truncated for column 'c1' at row 1 Warning 1265 Data truncated for column 'c2' at row 1 INSERT INTO t2 VALUES('0000-00-00','08-01-06','08-01-06','08/01/07'); INSERT INTO t3 VALUES('08-01-06','00-00-00','08-01-08','08/1/9'); INSERT INTO t4 VALUES('abcd','abcd','08-01-10','08/01/11'),(1234,1234,'08-01-12','08/01/13') /* Inserts zero dates for absurd dates */; Warnings: Warning 1265 Data truncated for column 'c1' at row 1 Warning 1265 Data truncated for column 'c2' at row 1 Warning 1264 Out of range value for column 'c1' at row 2 Warning 1264 Out of range value for column 'c2' at row 2 SELECT * FROM t1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t4; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-10 00:00:00 2008-01-11 00:00:00 0000-00-00 0000-00-00 2008-01-12 00:00:00 2008-01-13 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t1; total_rows min_value max(c1) 11 0000-00-00 2009-01-29 SELECT * FROM t1 WHERE c3 = '2007-05-24'; c1 c2 c3 c4 SELECT c1 FROM t1; c1 0000-00-00 1983-09-05 1983-09-07 1998-12-28 1998-12-29 1998-12-30 1998-12-31 2007-05-23 2007-05-25 2008-01-01 2009-01-29 SELECT c1 FROM t1 ORDER BY c1 DESC; c1 2009-01-29 2008-01-01 2007-05-25 2007-05-23 1998-12-31 1998-12-30 1998-12-29 1998-12-28 1983-09-07 1983-09-05 0000-00-00 SELECT * FROM t1 ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c1 = '1998-12-31 11:30:45' ORDER BY c1; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 = '1998-12-31 11:30:45' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 = '1998-12-31 11:30:45' ORDER BY c1 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 = '1998-12-31 11:30:45' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 <> '1998-12-31 11:30:45' ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 <> '1998-12-31 11:30:45' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 > '1998-12-31 11:30:45' ORDER BY c1; c1 c2 c3 c4 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 > '1998-12-31 11:30:45' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 SELECT * FROM t1 WHERE c1 >= '1998-12-31 11:30:45' ORDER BY c1; c1 c2 c3 c4 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 >= '1998-12-31 11:30:45' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 SELECT * FROM t1 WHERE c1 < '1998-12-31 11:30:45' ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c1 < '1998-12-31 11:30:45' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 <= '1998-12-31 11:30:45' ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c1 <= '1998-12-31 11:30:45' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 <=> '1998-12-31 11:30:45' ORDER BY c1; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 <=> '1998-12-31 11:30:45' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00 00:00:00' AND '1998-12-29 00:00:00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00 00:00:00' AND '1998-12-29 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00 00:00:00','1998-12-29 00:00:00') ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00 00:00:00','1998-12-29 00:00:00') ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00 00:00:00' AND c1 < '1998-12-29 00:00:00' AND c2 = '1983-09-07 00:00:00' ORDER BY c1; c1 c2 c3 c4 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00 00:00:00' AND c1 < '1998-12-29 00:00:00' AND c2 = '1983-09-07 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 <> '1998-12-31 11:30:45' ORDER BY c1 DESC; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <> '1998-12-31 11:30:45' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c1 > '1998-12-31 11:30:45' ORDER BY c1 DESC; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 SELECT * FROM t1 WHERE c1 > '1998-12-31 11:30:45' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c1 >= '1998-12-31 11:30:45' ORDER BY c1 DESC; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 SELECT * FROM t1 WHERE c1 >= '1998-12-31 11:30:45' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c1 < '1998-12-31 11:30:45' ORDER BY c1 DESC; c1 c2 c3 c4 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 < '1998-12-31 11:30:45' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 SELECT * FROM t1 WHERE c1 <= '1998-12-31 11:30:45' ORDER BY c1 DESC; c1 c2 c3 c4 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <= '1998-12-31 11:30:45' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 SELECT * FROM t1 WHERE c1 <=> '1998-12-31 11:30:45' ORDER BY c1 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 <=> '1998-12-31 11:30:45' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00 00:00:00' AND '1998-12-29 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00 00:00:00' AND '1998-12-29 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00 00:00:00','1998-12-29 00:00:00') ORDER BY c1 DESC; c1 c2 c3 c4 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00 00:00:00','1998-12-29 00:00:00') ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00 00:00:00' AND c1 < '1998-12-29 00:00:00' AND c2 = '1983-09-07 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00 00:00:00' AND c1 < '1998-12-29 00:00:00' AND c2 = '1983-09-07 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 DESC; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t1; total_rows min_value max(c1) 11 0000-00-00 2009-01-29 SELECT * FROM t1 WHERE c3 = '2007-05-26'; c1 c2 c3 c4 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 SELECT c1 FROM t1; c1 0000-00-00 1983-09-05 1983-09-07 1998-12-28 1998-12-29 1998-12-30 1998-12-31 2007-05-23 2007-05-25 2008-01-01 2009-01-29 SELECT c1 FROM t1 ORDER BY c1 DESC; c1 2009-01-29 2008-01-01 2007-05-25 2007-05-23 1998-12-31 1998-12-30 1998-12-29 1998-12-28 1983-09-07 1983-09-05 0000-00-00 SELECT * FROM t1 ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c1 = '0000-00-00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 = '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 = '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 = '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <> '0000-00-00' ORDER BY c1; c1 c2 c3 c4 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 <> '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 SELECT * FROM t1 WHERE c1 > '0000-00-00' ORDER BY c1; c1 c2 c3 c4 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 > '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 < '0000-00-00' ORDER BY c1; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 < '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 <= '0000-00-00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <= '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <=> '0000-00-00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <=> '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '1998-12-31 11:30:45' ORDER BY c1; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '1998-12-31 11:30:45' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 <> '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 <> '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c1 > '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 > '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c1 < '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 < '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 <= '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <= '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <=> '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <=> '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1 DESC; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1 DESC; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '1998-12-31 11:30:45' ORDER BY c1 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '1998-12-31 11:30:45' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 DESC; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t1; total_rows min_value max(c2) 11 0000-00-00 2009-01-29 SELECT * FROM t1 WHERE c4 = '2007-05-26 00:00:00'; c1 c2 c3 c4 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 SELECT c2 FROM t1; c2 0000-00-00 1983-09-05 1983-09-07 1998-12-28 1998-12-29 1998-12-30 1998-12-31 2007-05-23 2007-05-25 2009-01-29 NULL SELECT c2 FROM t1 ORDER BY c2 DESC; c2 2009-01-29 2007-05-25 2007-05-23 1998-12-31 1998-12-30 1998-12-29 1998-12-28 1983-09-07 1983-09-05 0000-00-00 NULL SELECT * FROM t1 ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 SELECT * FROM t1 WHERE c2 = '1998-12-30 11:30:45' ORDER BY c2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 = '1998-12-30 11:30:45' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 = '1998-12-30 11:30:45' ORDER BY c2 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 = '1998-12-30 11:30:45' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 <> '1998-12-30 11:30:45' ORDER BY c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c2 <> '1998-12-30 11:30:45' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 > '1998-12-30 11:30:45' ORDER BY c2; c1 c2 c3 c4 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c2 > '1998-12-30 11:30:45' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 SELECT * FROM t1 WHERE c2 >= '1998-12-30 11:30:45' ORDER BY c2; c1 c2 c3 c4 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c2 >= '1998-12-30 11:30:45' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 SELECT * FROM t1 WHERE c2 < '1998-12-30 11:30:45' ORDER BY c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 SELECT * FROM t1 WHERE c2 < '1998-12-30 11:30:45' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 <= '1998-12-30 11:30:45' ORDER BY c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 SELECT * FROM t1 WHERE c2 <= '1998-12-30 11:30:45' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 <=> '1998-12-30 11:30:45' ORDER BY c2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 <=> '1998-12-30 11:30:45' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '1998-12-31 11:30:45' ORDER BY c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '1998-12-31 11:30:45' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 IN ('0000-00-00 00:00:00','1998-12-31 11:30:45') ORDER BY c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 IN ('0000-00-00 00:00:00','1998-12-31 11:30:45') ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '1998-12-31 11:30:45' AND c1 = '0000-00-00 00:00:00' ORDER BY c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '1998-12-31 11:30:45' AND c1 = '0000-00-00 00:00:00' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2; c1 c2 c3 c4 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 <> '1998-12-30 11:30:45' ORDER BY c2 DESC; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 <> '1998-12-30 11:30:45' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 SELECT * FROM t1 WHERE c2 > '1998-12-30 11:30:45' ORDER BY c2 DESC; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c2 > '1998-12-30 11:30:45' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 SELECT * FROM t1 WHERE c2 >= '1998-12-30 11:30:45' ORDER BY c2 DESC; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c2 >= '1998-12-30 11:30:45' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 SELECT * FROM t1 WHERE c2 < '1998-12-30 11:30:45' ORDER BY c2 DESC; c1 c2 c3 c4 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 < '1998-12-30 11:30:45' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 SELECT * FROM t1 WHERE c2 <= '1998-12-30 11:30:45' ORDER BY c2 DESC; c1 c2 c3 c4 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 <= '1998-12-30 11:30:45' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 SELECT * FROM t1 WHERE c2 <=> '1998-12-30 11:30:45' ORDER BY c2 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 <=> '1998-12-30 11:30:45' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '1998-12-31 11:30:45' ORDER BY c2 DESC; c1 c2 c3 c4 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '1998-12-31 11:30:45' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 SELECT * FROM t1 WHERE c2 IN ('0000-00-00 00:00:00','1998-12-31 11:30:45') ORDER BY c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 IN ('0000-00-00 00:00:00','1998-12-31 11:30:45') ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '1998-12-31 11:30:45' AND c1 = '0000-00-00 00:00:00' ORDER BY c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '1998-12-31 11:30:45' AND c1 = '0000-00-00 00:00:00' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2 DESC; c1 c2 c3 c4 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2 DESC; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 SELECT * FROM t2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t2; total_rows min_value max(c1) 13 0000-00-00 2009-01-29 SELECT * FROM t2 WHERE c3 = '2008-01-06'; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT c1,c2 FROM t2; c1 c2 0000-00-00 0000-00-00 0000-00-00 2008-01-06 1983-09-05 1983-09-05 1983-09-07 1983-09-07 1998-12-28 1998-12-28 1998-12-29 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-30 1998-12-31 1998-12-30 1998-12-31 1998-12-31 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2009-01-29 2009-01-29 SELECT c1,c2 FROM t2 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 2008-01-06 0000-00-00 0000-00-00 1983-09-05 1983-09-05 1983-09-07 1983-09-07 1998-12-28 1998-12-28 1998-12-29 1998-12-30 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-31 1998-12-31 1998-12-31 1998-12-30 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2009-01-29 2009-01-29 SELECT * FROM t2 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 SELECT * FROM t2 WHERE c1 = '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 SELECT * FROM t2 WHERE c1 = '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 SELECT * FROM t2 WHERE c1 = '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 SELECT * FROM t2 WHERE c1 <> '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 <> '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 > '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 > '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 SELECT * FROM t2 WHERE c1 >= '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 >= '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 SELECT * FROM t2 WHERE c1 < '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 SELECT * FROM t2 WHERE c1 < '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 SELECT * FROM t2 WHERE c1 <= '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 SELECT * FROM t2 WHERE c1 <=> '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 SELECT * FROM t2 WHERE c1 BETWEEN '1983-09-07 00:00:00' AND '2007-05-23 09:15:28' ORDER BY c1,c2; c1 c2 c3 c4 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c1 BETWEEN '1983-09-07 00:00:00' AND '2007-05-23 09:15:28' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 SELECT * FROM t2 WHERE c1 IN ('1983-09-07 00:00:00','2007-05-23 09:15:28') ORDER BY c1,c2; c1 c2 c3 c4 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 SELECT * FROM t2 WHERE c1 IN ('1983-09-07 00:00:00','2007-05-23 09:15:28') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 SELECT * FROM t2 WHERE c1 >= '1983-09-07 00:00:00' AND c1 < '2007-05-23 09:15:28' AND c2 = '1998-12-30 11:30:45' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 >= '1983-09-07 00:00:00' AND c1 < '2007-05-23 09:15:28' AND c2 = '1998-12-30 11:30:45' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <> '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 <> '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 > '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 > '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 SELECT * FROM t2 WHERE c1 >= '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 >= '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 SELECT * FROM t2 WHERE c1 < '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 SELECT * FROM t2 WHERE c1 < '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 SELECT * FROM t2 WHERE c1 <= '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 SELECT * FROM t2 WHERE c1 <=> '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '1983-09-07 00:00:00' AND '2007-05-23 09:15:28' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c1 BETWEEN '1983-09-07 00:00:00' AND '2007-05-23 09:15:28' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 SELECT * FROM t2 WHERE c1 IN ('1983-09-07 00:00:00','2007-05-23 09:15:28') ORDER BY c1,c2 DESC; c1 c2 c3 c4 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 SELECT * FROM t2 WHERE c1 IN ('1983-09-07 00:00:00','2007-05-23 09:15:28') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 SELECT * FROM t2 WHERE c1 >= '1983-09-07 00:00:00' AND c1 < '2007-05-23 09:15:28' AND c2 = '1998-12-30 11:30:45' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 >= '1983-09-07 00:00:00' AND c1 < '2007-05-23 09:15:28' AND c2 = '1998-12-30 11:30:45' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t2; total_rows min_value max(c1) 13 0000-00-00 2009-01-29 SELECT * FROM t2 WHERE c3 = '1998-12-29'; c1 c2 c3 c4 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 SELECT c1,c2 FROM t2; c1 c2 0000-00-00 0000-00-00 0000-00-00 2008-01-06 1983-09-05 1983-09-05 1983-09-07 1983-09-07 1998-12-28 1998-12-28 1998-12-29 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-30 1998-12-31 1998-12-30 1998-12-31 1998-12-31 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2009-01-29 2009-01-29 SELECT c1,c2 FROM t2 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 2008-01-06 0000-00-00 0000-00-00 1983-09-05 1983-09-05 1983-09-07 1983-09-07 1998-12-28 1998-12-28 1998-12-29 1998-12-30 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-31 1998-12-31 1998-12-31 1998-12-30 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2009-01-29 2009-01-29 SELECT * FROM t2 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <> '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 <> '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 SELECT * FROM t2 WHERE c1 > '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 > '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 < '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 < '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 <= '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '2007-05-23 09:15:28' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '2007-05-23 09:15:28' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <> '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 <> '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 SELECT * FROM t2 WHERE c1 > '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 > '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 < '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 < '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 <= '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '2007-05-23 09:15:28' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '2007-05-23 09:15:28' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t2; total_rows min_value max(c2) 13 0000-00-00 2009-01-29 SELECT * FROM t2 WHERE c4 = '2007-05-24 09:15:28'; c1 c2 c3 c4 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 SELECT c1,c2 FROM t2; c1 c2 0000-00-00 0000-00-00 0000-00-00 2008-01-06 1983-09-05 1983-09-05 1983-09-07 1983-09-07 1998-12-28 1998-12-28 1998-12-29 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-30 1998-12-31 1998-12-30 1998-12-31 1998-12-31 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2009-01-29 2009-01-29 SELECT c1,c2 FROM t2 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 2008-01-06 0000-00-00 0000-00-00 1983-09-05 1983-09-05 1983-09-07 1983-09-07 1998-12-28 1998-12-28 1998-12-29 1998-12-30 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-31 1998-12-31 1998-12-31 1998-12-30 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2009-01-29 2009-01-29 SELECT * FROM t2 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 = '1983-09-05 13:28:00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 = '1983-09-05 13:28:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 = '1983-09-05 13:28:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 = '1983-09-05 13:28:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 <> '1983-09-05 13:28:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 <> '1983-09-05 13:28:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 > '1983-09-05 13:28:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 > '1983-09-05 13:28:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 SELECT * FROM t2 WHERE c2 >= '1983-09-05 13:28:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 >= '1983-09-05 13:28:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 SELECT * FROM t2 WHERE c2 < '1983-09-05 13:28:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 < '1983-09-05 13:28:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 <= '1983-09-05 13:28:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 <= '1983-09-05 13:28:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 <=> '1983-09-05 13:28:00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 <=> '1983-09-05 13:28:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '2007-05-23 09:15:28' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '2007-05-23 09:15:28' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 IN ('0000-00-00 00:00:00','2007-05-23 09:15:28') ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IN ('0000-00-00 00:00:00','2007-05-23 09:15:28') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '2007-05-23 09:15:28' AND c1 = '0000-00-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '2007-05-23 09:15:28' AND c1 = '0000-00-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <> '1983-09-05 13:28:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 <> '1983-09-05 13:28:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 > '1983-09-05 13:28:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 > '1983-09-05 13:28:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 SELECT * FROM t2 WHERE c2 >= '1983-09-05 13:28:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 >= '1983-09-05 13:28:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 SELECT * FROM t2 WHERE c2 < '1983-09-05 13:28:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 < '1983-09-05 13:28:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 <= '1983-09-05 13:28:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 <= '1983-09-05 13:28:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 <=> '1983-09-05 13:28:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 <=> '1983-09-05 13:28:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '2007-05-23 09:15:28' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '2007-05-23 09:15:28' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 IN ('0000-00-00 00:00:00','2007-05-23 09:15:28') ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IN ('0000-00-00 00:00:00','2007-05-23 09:15:28') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '2007-05-23 09:15:28' AND c1 = '0000-00-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '2007-05-23 09:15:28' AND c1 = '0000-00-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t3; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t3; total_rows min_value max(c1) 14 0000-00-00 2009-01-29 SELECT * FROM t3 WHERE c3 = '2007-05-24'; c1 c2 c3 c4 SELECT c1,c2 FROM t3; c1 c2 0000-00-00 0000-00-00 1983-09-05 1983-09-05 1983-09-07 1983-09-07 1998-12-28 1998-12-28 1998-12-29 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-30 1998-12-31 1998-12-30 1998-12-31 1998-12-31 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2008-01-01 NULL 2008-01-06 0000-00-00 2009-01-29 2009-01-29 SELECT c1,c2 FROM t3 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 0000-00-00 1983-09-05 1983-09-05 1983-09-07 1983-09-07 1998-12-28 1998-12-28 1998-12-29 1998-12-30 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-31 1998-12-31 1998-12-31 1998-12-30 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2008-01-01 NULL 2008-01-06 0000-00-00 2009-01-29 2009-01-29 SELECT * FROM t3 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 = '1998-12-28 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 SELECT * FROM t3 WHERE c1 = '1998-12-28 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 SELECT * FROM t3 WHERE c1 = '1998-12-28 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 SELECT * FROM t3 WHERE c1 = '1998-12-28 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 SELECT * FROM t3 WHERE c1 <> '1998-12-28 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 <> '1998-12-28 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 > '1998-12-28 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 > '1998-12-28 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 SELECT * FROM t3 WHERE c1 >= '1998-12-28 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 >= '1998-12-28 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c1 < '1998-12-28 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 SELECT * FROM t3 WHERE c1 < '1998-12-28 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 <= '1998-12-28 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 SELECT * FROM t3 WHERE c1 <= '1998-12-28 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 <=> '1998-12-28 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 SELECT * FROM t3 WHERE c1 <=> '1998-12-28 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '1998-12-31 11:30:45' AND '2008-01-06 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '1998-12-31 11:30:45' AND '2008-01-06 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 SELECT * FROM t3 WHERE c1 IN ('1998-12-31 11:30:45','2008-01-06 00:00:00') ORDER BY c1,c2; c1 c2 c3 c4 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IN ('1998-12-31 11:30:45','2008-01-06 00:00:00') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 >= '1998-12-31 11:30:45' AND c1 < '2008-01-06 00:00:00' AND c2 = '1998-12-28 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 >= '1998-12-31 11:30:45' AND c1 < '2008-01-06 00:00:00' AND c2 = '1998-12-28 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 <> '1998-12-28 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 <> '1998-12-28 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 > '1998-12-28 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 > '1998-12-28 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c1 >= '1998-12-28 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 >= '1998-12-28 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 SELECT * FROM t3 WHERE c1 < '1998-12-28 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 SELECT * FROM t3 WHERE c1 < '1998-12-28 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 <= '1998-12-28 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 SELECT * FROM t3 WHERE c1 <= '1998-12-28 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 <=> '1998-12-28 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 SELECT * FROM t3 WHERE c1 <=> '1998-12-28 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '1998-12-31 11:30:45' AND '2008-01-06 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '1998-12-31 11:30:45' AND '2008-01-06 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 SELECT * FROM t3 WHERE c1 IN ('1998-12-31 11:30:45','2008-01-06 00:00:00') ORDER BY c1,c2 DESC; c1 c2 c3 c4 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IN ('1998-12-31 11:30:45','2008-01-06 00:00:00') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 >= '1998-12-31 11:30:45' AND c1 < '2008-01-06 00:00:00' AND c2 = '1998-12-28 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 >= '1998-12-31 11:30:45' AND c1 < '2008-01-06 00:00:00' AND c2 = '1998-12-28 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t3; total_rows min_value max(c1) 14 0000-00-00 2009-01-29 SELECT * FROM t3 WHERE c3 = '1998-12-29'; c1 c2 c3 c4 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 SELECT c1,c2 FROM t3; c1 c2 0000-00-00 0000-00-00 1983-09-05 1983-09-05 1983-09-07 1983-09-07 1998-12-28 1998-12-28 1998-12-29 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-30 1998-12-31 1998-12-30 1998-12-31 1998-12-31 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2008-01-01 NULL 2008-01-06 0000-00-00 2009-01-29 2009-01-29 SELECT c1,c2 FROM t3 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 0000-00-00 1983-09-05 1983-09-05 1983-09-07 1983-09-07 1998-12-28 1998-12-28 1998-12-29 1998-12-30 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-31 1998-12-31 1998-12-31 1998-12-30 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2008-01-01 NULL 2008-01-06 0000-00-00 2009-01-29 2009-01-29 SELECT * FROM t3 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 = '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 = '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 = '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 = '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <> '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 <> '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 SELECT * FROM t3 WHERE c1 > '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 > '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 < '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 < '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 <= '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <= '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '1998-12-30 11:30:45' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '1998-12-30 11:30:45' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 <> '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 <> '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 SELECT * FROM t3 WHERE c1 > '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 > '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 < '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 < '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 <= '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <= '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '1998-12-30 11:30:45' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '1998-12-30 11:30:45' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t3; total_rows min_value max(c2) 14 0000-00-00 2009-01-29 SELECT * FROM t3 WHERE c4 = '2007-05-24 09:15:28'; c1 c2 c3 c4 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 SELECT c1,c2 FROM t3; c1 c2 0000-00-00 0000-00-00 1983-09-05 1983-09-05 1983-09-07 1983-09-07 1998-12-28 1998-12-28 1998-12-29 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-30 1998-12-31 1998-12-30 1998-12-31 1998-12-31 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2008-01-01 NULL 2008-01-06 0000-00-00 2009-01-29 2009-01-29 SELECT c1,c2 FROM t3 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 0000-00-00 1983-09-05 1983-09-05 1983-09-07 1983-09-07 1998-12-28 1998-12-28 1998-12-29 1998-12-30 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-31 1998-12-31 1998-12-31 1998-12-30 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2008-01-01 NULL 2008-01-06 0000-00-00 2009-01-29 2009-01-29 SELECT * FROM t3 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 = '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c2 = '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c2 = '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c2 = '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c2 <> '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 <> '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 > '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 > '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 SELECT * FROM t3 WHERE c2 >= '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 >= '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 SELECT * FROM t3 WHERE c2 < '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 < '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 <= '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 <= '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 <=> '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c2 <=> '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '1998-12-30 11:30:45' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '1998-12-30 11:30:45' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 IN ('0000-00-00 00:00:00','1998-12-30 11:30:45') ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 IN ('0000-00-00 00:00:00','1998-12-30 11:30:45') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '1998-12-30 11:30:45' AND c1 = '0000-00-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '1998-12-30 11:30:45' AND c1 = '0000-00-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 <> '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 <> '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 > '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 > '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 SELECT * FROM t3 WHERE c2 >= '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 >= '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c2 < '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 < '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 <= '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 <= '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 <=> '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c2 <=> '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '1998-12-30 11:30:45' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '1998-12-30 11:30:45' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 IN ('0000-00-00 00:00:00','1998-12-30 11:30:45') ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 IN ('0000-00-00 00:00:00','1998-12-30 11:30:45') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '1998-12-30 11:30:45' AND c1 = '0000-00-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '1998-12-30 11:30:45' AND c1 = '0000-00-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 INSERT INTO t1(c1,c2) VALUES('20070525','070523091528') /* Row with c1='20070525' exists */; ERROR 23000: Duplicate entry '2007-05-25' for key 'PRIMARY' INSERT INTO t2(c1,c2) VALUES(19830907,830907) /* Row with c1=19830907,c2=830907 exists */; ERROR 23000: Duplicate entry '1983-09-07-1983-09-07' for key 'PRIMARY' INSERT INTO t1(c1,c2) VALUES(19840905,830907) /* Row with c2=830907 exists */; ERROR 23000: Duplicate entry '1983-09-07' for key 'c2' INSERT INTO t3(c1,c2) VALUES(19830907,830907) /* Row with c1=19830907,c2=830907 exists */; ERROR 23000: Duplicate entry '1983-09-07-1983-09-07' for key 'idx' INSERT IGNORE INTO t1(c1,c2) VALUES('20070525','20070527') /* doesn't throw error */; INSERT IGNORE INTO t2(c1,c2) VALUES(19830907,830907) /* doesn't throw error */; INSERT IGNORE INTO t1(c1,c2) VALUES(19840905,830907) /* doesn't throw error */; INSERT IGNORE INTO t3(c1,c2) VALUES(19830907,830907) /* doesn't throw error */; SELECT * FROM t1 WHERE c1='20070525' /* Returns 1 row with c1=2007-05-25 */; c1 c2 c3 c4 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 SELECT * FROM t2 WHERE c1=19830907 AND c2=830907 /* Returns 1 row with c1=1983-09-07 and c2=1983-09-07 */; c1 c2 c3 c4 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 SELECT * FROM t1 WHERE c2=830907 /* Returns 1 row with c2=1983-09-07 */; c1 c2 c3 c4 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 SELECT * FROM t3 WHERE c1=19830907 AND c2=830907 /* Returns 1 row with c1=1983-09-07 and c2=1983-09-07 */; c1 c2 c3 c4 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 SELECT * FROM t1 WHERE c1='20070527' /* Returns no rows */; c1 c2 c3 c4 INSERT INTO t1(c1) VALUES('20070525') ON DUPLICATE KEY UPDATE c1='20070527'; SELECT * FROM t1 WHERE c1='20070527' /* Returns 1 row with c1=2007-05-27 */; c1 c2 c3 c4 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1=19830909 AND c2=830910 /* Returns no rows */; c1 c2 c3 c4 INSERT INTO t2(c1,c2) VALUES(19830907,830907) ON DUPLICATE KEY UPDATE c1=19830909,c2=830910; SELECT * FROM t2 WHERE c1=19830909 AND c2=830910 /* Returns 1 row with c1=19830909,c2=830910 */; c1 c2 c3 c4 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1=19830909 AND c2=830910 /* Returns no rows */; c1 c2 c3 c4 INSERT INTO t1(c1,c2) VALUES(19840905,830907) ON DUPLICATE KEY UPDATE c1=19830909,c2=830910; SELECT * FROM t1 WHERE c1=19830909 AND c2=830910 /* Returns 1 row */; c1 c2 c3 c4 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1=19830909 AND c2=830910 /* Returns no rows */; c1 c2 c3 c4 INSERT INTO t3(c1,c2) VALUES(19830907,830907) ON DUPLICATE KEY UPDATE c1=19830909,c2=830910; SELECT * FROM t3 WHERE c1=19830909 AND c2=830910 /* Returns 1 row */; c1 c2 c3 c4 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 INSERT INTO t1 SET c1='1999-01-01',c2='1999-01-01'; INSERT INTO t2 SET c1='1999-01-01',c2='1999-01-01'; INSERT INTO t3 SET c1='1999-01-01'; INSERT INTO t4 SET c2='1999-01-01'; Warnings: Warning 1364 Field 'c1' doesn't have a default value SELECT * FROM t1 WHERE c1='1999-01-01' AND c2='1999-01-01' /* Returns 1 row with values for other column as NULL */; c1 c2 c3 c4 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1='1999-01-01' AND c2='1999-01-01' /* Returns 1 row with values for other column as NULL */; c1 c2 c3 c4 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1='1999-01-01' /* Returns 1 row with values for other column as NULL */; c1 c2 c3 c4 1999-01-01 NULL NULL 2009-01-29 11:11:27 SELECT * FROM t4 WHERE c2='1999-01-01' /* Returns 1 row with values for other column as NULL */; c1 c2 c3 c4 0000-00-00 1999-01-01 NULL 2009-01-29 11:11:27 CREATE TABLE t5(c1 DATE NOT NULL, c2 DATE NULL, c3 DATETIME, c4 TIMESTAMP, INDEX idx(c1,c2)); INSERT INTO t5 SELECT * FROM t1 WHERE c1 >=0 AND c1 < '20070523091528'; SELECT * FROM t5; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 TRUNCATE TABLE t5; INSERT INTO t5 SELECT * FROM t2 WHERE c1 >='98-12-31 11:30:45' AND c1 < '20070523091528' AND c2 <> '070525'; SELECT * FROM t5; c1 c2 c3 c4 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 TRUNCATE TABLE t5; INSERT INTO t5 SELECT * FROM t3 WHERE c2 BETWEEN 0 AND '1998-12-30 11:30:45'; Warnings: Warning 1292 Truncated incorrect INTEGER value: '1998-12-30 11:30:45' Warning 1292 Truncated incorrect INTEGER value: '1998-12-30 11:30:45' Warning 1292 Truncated incorrect INTEGER value: '1998-12-30 11:30:45' Warning 1292 Truncated incorrect INTEGER value: '1998-12-30 11:30:45' Warning 1292 Truncated incorrect INTEGER value: '1998-12-30 11:30:45' Warning 1292 Truncated incorrect INTEGER value: '1998-12-30 11:30:45' Warning 1292 Truncated incorrect INTEGER value: '1998-12-30 11:30:45' Warning 1292 Truncated incorrect INTEGER value: '1998-12-30 11:30:45' Warning 1292 Truncated incorrect INTEGER value: '1998-12-30 11:30:45' Warning 1292 Truncated incorrect INTEGER value: '1998-12-30 11:30:45' Warning 1292 Truncated incorrect INTEGER value: '1998-12-30 11:30:45' Warning 1292 Truncated incorrect INTEGER value: '1998-12-30 11:30:45' Warning 1292 Truncated incorrect INTEGER value: '1998-12-30 11:30:45' SELECT * FROM t5; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 TRUNCATE TABLE t5; DROP TABLE t5; INSERT INTO t1 VALUES('1000-01-01','2000-01-01','2009-01-01','2009-01-02'),('3000-01-01','4000-01-01','2009-01-03','2009-01-04'),('5000-01-01','6000-01-01','2009-01-05','2009-01-06'),('7000-01-01','8000-01-01','2009-01-07','2009-01-08'),('9000-01-01','9000-01-01','2009-01-09','2009-01-10'),('9999-12-31','9999-12-31','2009-01-11','2009-01-12'); INSERT INTO t2 VALUES('1000-01-01','2000-01-01','2009-01-01','2009-01-02'),('3000-01-01','4000-01-01','2009-01-03','2009-01-04'),('5000-01-01','6000-01-01','2009-01-05','2009-01-06'),('7000-01-01','8000-01-01','2009-01-07','2009-01-08'),('9000-01-01','9000-01-01','2009-01-09','2009-01-10'),('9999-12-31','9999-12-31','2009-01-11','2009-01-12'); INSERT INTO t3 VALUES('1000-01-01','2000-01-01','2009-01-01','2009-01-02'),('3000-01-01','4000-01-01','2009-01-03','2009-01-04'),('5000-01-01','6000-01-01','2009-01-05','2009-01-06'),('7000-01-01','8000-01-01','2009-01-07','2009-01-08'),('9000-01-01','9000-01-01','2009-01-09','2009-01-10'),('9999-12-31','9999-12-31','2009-01-11','2009-01-12'); INSERT INTO t4 VALUES('1000-01-01','2000-01-01','2009-01-01','2009-01-02'),('3000-01-01','4000-01-01','2009-01-03','2009-01-04'),('5000-01-01','6000-01-01','2009-01-05','2009-01-06'),('7000-01-01','8000-01-01','2009-01-07','2009-01-08'),('9000-01-01','9000-01-01','2009-01-09','2009-01-10'),('9999-12-31','9999-12-31','2009-01-11','2009-01-12'); INSERT INTO t1(c1,c2) VALUES('2010-00-01','2010-10-00'); INSERT INTO t2(c1,c2) VALUES('2010-00-01','2010-10-00'); INSERT INTO t3(c1,c2) VALUES('2010-00-01','2010-10-00'); INSERT INTO t4(c1,c2) VALUES('2010-00-01','2010-10-00'); INSERT INTO t4(c1) VALUES('2009-02-30'),('2009-04-31'),('2009-06-31'),('2009-09-31'),('2009-11-31'),('2009-13-01'),('2009-12-32'); Warnings: Warning 1265 Data truncated for column 'c1' at row 1 Warning 1265 Data truncated for column 'c1' at row 2 Warning 1265 Data truncated for column 'c1' at row 3 Warning 1265 Data truncated for column 'c1' at row 4 Warning 1265 Data truncated for column 'c1' at row 5 Warning 1265 Data truncated for column 'c1' at row 6 Warning 1265 Data truncated for column 'c1' at row 7 INSERT INTO t1(c1) VALUES(NULL); ERROR 23000: Column 'c1' cannot be null INSERT INTO t2(c1) VALUES(NULL); ERROR 23000: Column 'c1' cannot be null INSERT INTO t3 VALUES(NULL,'2008-01-14','08-01-15','08/01/16'); ERROR 23000: Column 'c1' cannot be null INSERT INTO t4 VALUES(NULL,'2008-01-14','08-01-15','08/01/16'); ERROR 23000: Column 'c1' cannot be null SET SQL_MODE=STRICT_ALL_TABLES; INSERT INTO t4 SET c2='1999-01-01' /* NOT NULL column will not get the default value */; ERROR HY000: Field 'c1' doesn't have a default value SET SQL_MODE=''; SELECT * FROM t1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t4; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-10 00:00:00 2008-01-11 00:00:00 0000-00-00 0000-00-00 2008-01-12 00:00:00 2008-01-13 00:00:00 0000-00-00 1999-01-01 NULL 2009-01-29 11:11:27 0000-00-00 NULL NULL 2009-01-29 11:11:27 0000-00-00 NULL NULL 2009-01-29 11:11:27 0000-00-00 NULL NULL 2009-01-29 11:11:27 0000-00-00 NULL NULL 2009-01-29 11:11:27 0000-00-00 NULL NULL 2009-01-29 11:11:27 0000-00-00 NULL NULL 2009-01-29 11:11:27 0000-00-00 NULL NULL 2009-01-29 11:11:27 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-07 1983-09-07 1983-09-08 00:00:00 1983-09-08 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t1; total_rows min_value max(c1) 19 0000-00-00 9999-12-31 SELECT * FROM t1 WHERE c3 = '2007-05-24 09:15:28'; c1 c2 c3 c4 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 SELECT c1 FROM t1; c1 0000-00-00 1000-01-01 1983-09-05 1983-09-09 1998-12-28 1998-12-29 1998-12-30 1998-12-31 1999-01-01 2007-05-23 2007-05-27 2008-01-01 2009-01-29 2010-00-01 3000-01-01 5000-01-01 7000-01-01 9000-01-01 9999-12-31 SELECT c1 FROM t1 ORDER BY c1 DESC; c1 9999-12-31 9000-01-01 7000-01-01 5000-01-01 3000-01-01 2010-00-01 2009-01-29 2008-01-01 2007-05-27 2007-05-23 1999-01-01 1998-12-31 1998-12-30 1998-12-29 1998-12-28 1983-09-09 1983-09-05 1000-01-01 0000-00-00 SELECT * FROM t1 ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t1 ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c1 = '1000-00-01' ORDER BY c1; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 = '1000-00-01' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 = '1000-00-01' ORDER BY c1 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 = '1000-00-01' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 <> '1000-00-01' ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 <> '1000-00-01' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 > '1000-00-01' ORDER BY c1; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 > '1000-00-01' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 >= '1000-00-01' ORDER BY c1; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 >= '1000-00-01' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 < '1000-00-01' ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 < '1000-00-01' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <= '1000-00-01' ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <= '1000-00-01' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <=> '1000-00-01' ORDER BY c1; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 <=> '1000-00-01' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 BETWEEN '1000-00-01' AND '9999-12-31' ORDER BY c1; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '1000-00-01' AND '9999-12-31' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 IN ('1000-00-01','9999-12-31') ORDER BY c1; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 IN ('1000-00-01','9999-12-31') ORDER BY c1 LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 >= '1000-00-01' AND c1 < '9999-12-31' AND c2 = '1000-00-01' ORDER BY c1; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 >= '1000-00-01' AND c1 < '9999-12-31' AND c2 = '1000-00-01' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 <> '1000-00-01' ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <> '1000-00-01' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c1 > '1000-00-01' ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 > '1000-00-01' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c1 >= '1000-00-01' ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 >= '1000-00-01' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c1 < '1000-00-01' ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 < '1000-00-01' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <= '1000-00-01' ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <= '1000-00-01' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <=> '1000-00-01' ORDER BY c1 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 <=> '1000-00-01' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 BETWEEN '1000-00-01' AND '9999-12-31' ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '1000-00-01' AND '9999-12-31' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c1 IN ('1000-00-01','9999-12-31') ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 IN ('1000-00-01','9999-12-31') ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 >= '1000-00-01' AND c1 < '9999-12-31' AND c2 = '1000-00-01' ORDER BY c1 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 >= '1000-00-01' AND c1 < '9999-12-31' AND c2 = '1000-00-01' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t1; total_rows min_value max(c1) 19 0000-00-00 9999-12-31 SELECT * FROM t1 WHERE c3 = '2007-05-26 00:00:00'; c1 c2 c3 c4 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 SELECT c1 FROM t1; c1 0000-00-00 1000-01-01 1983-09-05 1983-09-09 1998-12-28 1998-12-29 1998-12-30 1998-12-31 1999-01-01 2007-05-23 2007-05-27 2008-01-01 2009-01-29 2010-00-01 3000-01-01 5000-01-01 7000-01-01 9000-01-01 9999-12-31 SELECT c1 FROM t1 ORDER BY c1 DESC; c1 9999-12-31 9000-01-01 7000-01-01 5000-01-01 3000-01-01 2010-00-01 2009-01-29 2008-01-01 2007-05-27 2007-05-23 1999-01-01 1998-12-31 1998-12-30 1998-12-29 1998-12-28 1983-09-09 1983-09-05 1000-01-01 0000-00-00 SELECT * FROM t1 ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t1 ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c1 = '0000-00-00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 = '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 = '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 = '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <> '0000-00-00' ORDER BY c1; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 <> '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 > '0000-00-00' ORDER BY c1; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 > '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 < '0000-00-00' ORDER BY c1; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 < '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 <= '0000-00-00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <= '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <=> '0000-00-00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <=> '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '9999-12-31' ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '9999-12-31' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','9999-12-31') ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','9999-12-31') ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '9999-12-31' AND c2 = '2010-10-00' ORDER BY c1; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '9999-12-31' AND c2 = '2010-10-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 <> '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 <> '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c1 > '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 > '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c1 < '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 < '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 <= '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <= '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <=> '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <=> '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '9999-12-31' ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '9999-12-31' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','9999-12-31') ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','9999-12-31') ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '9999-12-31' AND c2 = '2010-10-00' ORDER BY c1 DESC; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '9999-12-31' AND c2 = '2010-10-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t1; total_rows min_value max(c1) 19 0000-00-00 9999-12-31 SELECT * FROM t1 WHERE c3 = '1998-12-28 00:00:00'; c1 c2 c3 c4 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 SELECT c1 FROM t1; c1 0000-00-00 1000-01-01 1983-09-05 1983-09-09 1998-12-28 1998-12-29 1998-12-30 1998-12-31 1999-01-01 2007-05-23 2007-05-27 2008-01-01 2009-01-29 2010-00-01 3000-01-01 5000-01-01 7000-01-01 9000-01-01 9999-12-31 SELECT c1 FROM t1 ORDER BY c1 DESC; c1 9999-12-31 9000-01-01 7000-01-01 5000-01-01 3000-01-01 2010-00-01 2009-01-29 2008-01-01 2007-05-27 2007-05-23 1999-01-01 1998-12-31 1998-12-30 1998-12-29 1998-12-28 1983-09-09 1983-09-05 1000-01-01 0000-00-00 SELECT * FROM t1 ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t1 ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c1 = '2010-00-01' ORDER BY c1; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 = '2010-00-01' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 = '2010-00-01' ORDER BY c1 DESC; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 = '2010-00-01' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 <> '2010-00-01' ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 <> '2010-00-01' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 > '2010-00-01' ORDER BY c1; c1 c2 c3 c4 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 > '2010-00-01' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c1 >= '2010-00-01' ORDER BY c1; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 >= '2010-00-01' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 SELECT * FROM t1 WHERE c1 < '2010-00-01' ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 < '2010-00-01' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 <= '2010-00-01' ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 <= '2010-00-01' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 <=> '2010-00-01' ORDER BY c1; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 <=> '2010-00-01' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01' ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','2010-00-01') ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','2010-00-01') ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01' AND c2 = '2010-10-00' ORDER BY c1; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01' AND c2 = '2010-10-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 <> '2010-00-01' ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <> '2010-00-01' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c1 > '2010-00-01' ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 SELECT * FROM t1 WHERE c1 > '2010-00-01' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c1 >= '2010-00-01' ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 >= '2010-00-01' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c1 < '2010-00-01' ORDER BY c1 DESC; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 < '2010-00-01' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c1 <= '2010-00-01' ORDER BY c1 DESC; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <= '2010-00-01' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 <=> '2010-00-01' ORDER BY c1 DESC; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 <=> '2010-00-01' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01' ORDER BY c1 DESC; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','2010-00-01') ORDER BY c1 DESC; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','2010-00-01') ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01' AND c2 = '2010-10-00' ORDER BY c1 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01' AND c2 = '2010-10-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t1; total_rows min_value max(c2) 19 0000-00-00 9999-12-31 SELECT * FROM t1 WHERE c4 = '2009-01-29'; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT c2 FROM t1; c2 0000-00-00 1983-09-05 1983-09-10 1998-12-28 1998-12-29 1998-12-30 1998-12-31 1999-01-01 2000-01-01 2007-05-23 2007-05-25 2009-01-29 2010-10-00 4000-01-01 6000-01-01 8000-01-01 9000-01-01 9999-12-31 NULL SELECT c2 FROM t1 ORDER BY c2 DESC; c2 9999-12-31 9000-01-01 8000-01-01 6000-01-01 4000-01-01 2010-10-00 2009-01-29 2007-05-25 2007-05-23 2000-01-01 1999-01-01 1998-12-31 1998-12-30 1998-12-29 1998-12-28 1983-09-10 1983-09-05 0000-00-00 NULL SELECT * FROM t1 ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c2 = '9999-12-31' ORDER BY c2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 = '9999-12-31' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 = '9999-12-31' ORDER BY c2 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 = '9999-12-31' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 <> '9999-12-31' ORDER BY c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c2 <> '9999-12-31' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 > '9999-12-31' ORDER BY c2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 > '9999-12-31' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 >= '9999-12-31' ORDER BY c2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 >= '9999-12-31' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 < '9999-12-31' ORDER BY c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c2 < '9999-12-31' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 <= '9999-12-31' ORDER BY c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 <= '9999-12-31' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 <=> '9999-12-31' ORDER BY c2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 <=> '9999-12-31' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 BETWEEN '1000-00-01' AND '9999-12-31' ORDER BY c2; c1 c2 c3 c4 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 BETWEEN '1000-00-01' AND '9999-12-31' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 IN ('1000-00-01','9999-12-31') ORDER BY c2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 IN ('1000-00-01','9999-12-31') ORDER BY c2 LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 >= '1000-00-01' AND c2 < '9999-12-31' AND c1 = '9999-12-31' ORDER BY c2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 >= '1000-00-01' AND c2 < '9999-12-31' AND c1 = '9999-12-31' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2; c1 c2 c3 c4 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 <> '9999-12-31' ORDER BY c2 DESC; c1 c2 c3 c4 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 <> '9999-12-31' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 SELECT * FROM t1 WHERE c2 > '9999-12-31' ORDER BY c2 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 > '9999-12-31' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 >= '9999-12-31' ORDER BY c2 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 >= '9999-12-31' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 < '9999-12-31' ORDER BY c2 DESC; c1 c2 c3 c4 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 < '9999-12-31' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 SELECT * FROM t1 WHERE c2 <= '9999-12-31' ORDER BY c2 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 <= '9999-12-31' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c2 <=> '9999-12-31' ORDER BY c2 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 <=> '9999-12-31' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 BETWEEN '1000-00-01' AND '9999-12-31' ORDER BY c2 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 BETWEEN '1000-00-01' AND '9999-12-31' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c2 IN ('1000-00-01','9999-12-31') ORDER BY c2 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 IN ('1000-00-01','9999-12-31') ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 >= '1000-00-01' AND c2 < '9999-12-31' AND c1 = '9999-12-31' ORDER BY c2 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 >= '1000-00-01' AND c2 < '9999-12-31' AND c1 = '9999-12-31' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2 DESC; c1 c2 c3 c4 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t1; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t1; total_rows min_value max(c2) 19 0000-00-00 9999-12-31 SELECT * FROM t1 WHERE c4 = '2008-01-05'; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT c2 FROM t1; c2 0000-00-00 1983-09-05 1983-09-10 1998-12-28 1998-12-29 1998-12-30 1998-12-31 1999-01-01 2000-01-01 2007-05-23 2007-05-25 2009-01-29 2010-10-00 4000-01-01 6000-01-01 8000-01-01 9000-01-01 9999-12-31 NULL SELECT c2 FROM t1 ORDER BY c2 DESC; c2 9999-12-31 9000-01-01 8000-01-01 6000-01-01 4000-01-01 2010-10-00 2009-01-29 2007-05-25 2007-05-23 2000-01-01 1999-01-01 1998-12-31 1998-12-30 1998-12-29 1998-12-28 1983-09-10 1983-09-05 0000-00-00 NULL SELECT * FROM t1 ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c2 = '2010-10-00' ORDER BY c2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 = '2010-10-00' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 = '2010-10-00' ORDER BY c2 DESC; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 = '2010-10-00' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 <> '2010-10-00' ORDER BY c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 <> '2010-10-00' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 > '2010-10-00' ORDER BY c2; c1 c2 c3 c4 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 > '2010-10-00' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c2 >= '2010-10-00' ORDER BY c2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 >= '2010-10-00' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 SELECT * FROM t1 WHERE c2 < '2010-10-00' ORDER BY c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c2 < '2010-10-00' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 <= '2010-10-00' ORDER BY c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 <= '2010-10-00' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 <=> '2010-10-00' ORDER BY c2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 <=> '2010-10-00' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 BETWEEN '1000-00-01' AND '2010-10-00' ORDER BY c2; c1 c2 c3 c4 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 BETWEEN '1000-00-01' AND '2010-10-00' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 IN ('1000-00-01','2010-10-00') ORDER BY c2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 IN ('1000-00-01','2010-10-00') ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 >= '1000-00-01' AND c2 < '2010-10-00' AND c1 = '2010-00-01' ORDER BY c2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 >= '1000-00-01' AND c2 < '2010-10-00' AND c1 = '2010-00-01' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2; c1 c2 c3 c4 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 <> '2010-10-00' ORDER BY c2 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 <> '2010-10-00' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c2 > '2010-10-00' ORDER BY c2 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 SELECT * FROM t1 WHERE c2 > '2010-10-00' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c2 >= '2010-10-00' ORDER BY c2 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 >= '2010-10-00' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c2 < '2010-10-00' ORDER BY c2 DESC; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 < '2010-10-00' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 <= '2010-10-00' ORDER BY c2 DESC; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 <= '2010-10-00' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c2 <=> '2010-10-00' ORDER BY c2 DESC; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 <=> '2010-10-00' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 BETWEEN '1000-00-01' AND '2010-10-00' ORDER BY c2 DESC; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 BETWEEN '1000-00-01' AND '2010-10-00' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c2 IN ('1000-00-01','2010-10-00') ORDER BY c2 DESC; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 IN ('1000-00-01','2010-10-00') ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 >= '1000-00-01' AND c2 < '2010-10-00' AND c1 = '2010-00-01' ORDER BY c2 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 >= '1000-00-01' AND c2 < '2010-10-00' AND c1 = '2010-00-01' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2 DESC; c1 c2 c3 c4 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2007-05-27 2007-05-25 2007-05-26 00:00:00 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 0000-00-00 0000-00-00 2008-01-04 00:00:00 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c1='1000-00-01' OR c2='9999-12-31'; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT c2 FROM t1 GROUP BY c2; c2 0000-00-00 1983-09-05 1983-09-10 1998-12-28 1998-12-29 1998-12-30 1998-12-31 1999-01-01 2000-01-01 2007-05-23 2007-05-25 2009-01-29 2010-10-00 4000-01-01 6000-01-01 8000-01-01 9000-01-01 9999-12-31 NULL SELECT * FROM t2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t2; total_rows min_value max(c1) 21 0000-00-00 9999-12-31 SELECT * FROM t2 WHERE c3 = '2007-05-24 09:15:28'; c1 c2 c3 c4 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 SELECT c1,c2 FROM t2; c1 c2 0000-00-00 0000-00-00 0000-00-00 2008-01-06 1000-01-01 2000-01-01 1983-09-05 1983-09-05 1983-09-09 1983-09-10 1998-12-28 1998-12-28 1998-12-29 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-30 1998-12-31 1998-12-30 1998-12-31 1998-12-31 1999-01-01 1999-01-01 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2009-01-29 2009-01-29 2010-00-01 2010-10-00 3000-01-01 4000-01-01 5000-01-01 6000-01-01 7000-01-01 8000-01-01 9000-01-01 9000-01-01 9999-12-31 9999-12-31 SELECT c1,c2 FROM t2 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 2008-01-06 0000-00-00 0000-00-00 1000-01-01 2000-01-01 1983-09-05 1983-09-05 1983-09-09 1983-09-10 1998-12-28 1998-12-28 1998-12-29 1998-12-30 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-31 1998-12-31 1998-12-31 1998-12-30 1999-01-01 1999-01-01 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2009-01-29 2009-01-29 2010-00-01 2010-10-00 3000-01-01 4000-01-01 5000-01-01 6000-01-01 7000-01-01 8000-01-01 9000-01-01 9000-01-01 9999-12-31 9999-12-31 SELECT * FROM t2 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '1000-00-01' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 = '1000-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 = '1000-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 = '1000-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 <> '1000-00-01' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 <> '1000-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 > '1000-00-01' ORDER BY c1,c2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 > '1000-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c1 >= '1000-00-01' ORDER BY c1,c2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 >= '1000-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c1 < '1000-00-01' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 < '1000-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '1000-00-01' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '1000-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '1000-00-01' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 <=> '1000-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 BETWEEN '1000-00-01' AND '9999-12-31' ORDER BY c1,c2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '1000-00-01' AND '9999-12-31' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c1 IN ('1000-00-01','9999-12-31') ORDER BY c1,c2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 IN ('1000-00-01','9999-12-31') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 >= '1000-00-01' AND c1 < '9999-12-31' AND c2 = '1000-00-01' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 >= '1000-00-01' AND c1 < '9999-12-31' AND c2 = '1000-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <> '1000-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 <> '1000-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 > '1000-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 > '1000-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c1 >= '1000-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 >= '1000-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c1 < '1000-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 < '1000-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '1000-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '1000-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '1000-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 <=> '1000-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 BETWEEN '1000-00-01' AND '9999-12-31' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '1000-00-01' AND '9999-12-31' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c1 IN ('1000-00-01','9999-12-31') ORDER BY c1,c2 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 IN ('1000-00-01','9999-12-31') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 >= '1000-00-01' AND c1 < '9999-12-31' AND c2 = '1000-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 >= '1000-00-01' AND c1 < '9999-12-31' AND c2 = '1000-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t2; total_rows min_value max(c1) 21 0000-00-00 9999-12-31 SELECT * FROM t2 WHERE c3 = '2007-05-26 00:00:00'; c1 c2 c3 c4 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 SELECT c1,c2 FROM t2; c1 c2 0000-00-00 0000-00-00 0000-00-00 2008-01-06 1000-01-01 2000-01-01 1983-09-05 1983-09-05 1983-09-09 1983-09-10 1998-12-28 1998-12-28 1998-12-29 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-30 1998-12-31 1998-12-30 1998-12-31 1998-12-31 1999-01-01 1999-01-01 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2009-01-29 2009-01-29 2010-00-01 2010-10-00 3000-01-01 4000-01-01 5000-01-01 6000-01-01 7000-01-01 8000-01-01 9000-01-01 9000-01-01 9999-12-31 9999-12-31 SELECT c1,c2 FROM t2 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 2008-01-06 0000-00-00 0000-00-00 1000-01-01 2000-01-01 1983-09-05 1983-09-05 1983-09-09 1983-09-10 1998-12-28 1998-12-28 1998-12-29 1998-12-30 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-31 1998-12-31 1998-12-31 1998-12-30 1999-01-01 1999-01-01 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2009-01-29 2009-01-29 2010-00-01 2010-10-00 3000-01-01 4000-01-01 5000-01-01 6000-01-01 7000-01-01 8000-01-01 9000-01-01 9000-01-01 9999-12-31 9999-12-31 SELECT * FROM t2 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <> '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 <> '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c1 > '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 > '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 < '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 < '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 <= '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '9999-12-31' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '9999-12-31' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','9999-12-31') ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','9999-12-31') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '9999-12-31' AND c2 = '2010-10-00' ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '9999-12-31' AND c2 = '2010-10-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <> '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 <> '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c1 > '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 > '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 < '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 < '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 <= '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '9999-12-31' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '9999-12-31' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','9999-12-31') ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','9999-12-31') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '9999-12-31' AND c2 = '2010-10-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '9999-12-31' AND c2 = '2010-10-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t2; total_rows min_value max(c1) 21 0000-00-00 9999-12-31 SELECT * FROM t2 WHERE c3 = '1998-12-28 00:00:00'; c1 c2 c3 c4 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 SELECT c1,c2 FROM t2; c1 c2 0000-00-00 0000-00-00 0000-00-00 2008-01-06 1000-01-01 2000-01-01 1983-09-05 1983-09-05 1983-09-09 1983-09-10 1998-12-28 1998-12-28 1998-12-29 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-30 1998-12-31 1998-12-30 1998-12-31 1998-12-31 1999-01-01 1999-01-01 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2009-01-29 2009-01-29 2010-00-01 2010-10-00 3000-01-01 4000-01-01 5000-01-01 6000-01-01 7000-01-01 8000-01-01 9000-01-01 9000-01-01 9999-12-31 9999-12-31 SELECT c1,c2 FROM t2 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 2008-01-06 0000-00-00 0000-00-00 1000-01-01 2000-01-01 1983-09-05 1983-09-05 1983-09-09 1983-09-10 1998-12-28 1998-12-28 1998-12-29 1998-12-30 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-31 1998-12-31 1998-12-31 1998-12-30 1999-01-01 1999-01-01 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2009-01-29 2009-01-29 2010-00-01 2010-10-00 3000-01-01 4000-01-01 5000-01-01 6000-01-01 7000-01-01 8000-01-01 9000-01-01 9000-01-01 9999-12-31 9999-12-31 SELECT * FROM t2 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '2010-00-01' ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 = '2010-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 = '2010-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 = '2010-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 <> '2010-00-01' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 <> '2010-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 > '2010-00-01' ORDER BY c1,c2; c1 c2 c3 c4 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 > '2010-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 >= '2010-00-01' ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 >= '2010-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 SELECT * FROM t2 WHERE c1 < '2010-00-01' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 < '2010-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '2010-00-01' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 <= '2010-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '2010-00-01' ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 <=> '2010-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','2010-00-01') ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','2010-00-01') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01' AND c2 = '2010-10-00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01' AND c2 = '2010-10-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <> '2010-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 <> '2010-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 > '2010-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 > '2010-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 >= '2010-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 >= '2010-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 SELECT * FROM t2 WHERE c1 < '2010-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 < '2010-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '2010-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 <= '2010-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '2010-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 <=> '2010-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','2010-00-01') ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','2010-00-01') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01' AND c2 = '2010-10-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01' AND c2 = '2010-10-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t2; total_rows min_value max(c2) 21 0000-00-00 9999-12-31 SELECT * FROM t2 WHERE c4 = '2009-01-29'; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT c1,c2 FROM t2; c1 c2 0000-00-00 0000-00-00 0000-00-00 2008-01-06 1000-01-01 2000-01-01 1983-09-05 1983-09-05 1983-09-09 1983-09-10 1998-12-28 1998-12-28 1998-12-29 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-30 1998-12-31 1998-12-30 1998-12-31 1998-12-31 1999-01-01 1999-01-01 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2009-01-29 2009-01-29 2010-00-01 2010-10-00 3000-01-01 4000-01-01 5000-01-01 6000-01-01 7000-01-01 8000-01-01 9000-01-01 9000-01-01 9999-12-31 9999-12-31 SELECT c1,c2 FROM t2 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 2008-01-06 0000-00-00 0000-00-00 1000-01-01 2000-01-01 1983-09-05 1983-09-05 1983-09-09 1983-09-10 1998-12-28 1998-12-28 1998-12-29 1998-12-30 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-31 1998-12-31 1998-12-31 1998-12-30 1999-01-01 1999-01-01 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2009-01-29 2009-01-29 2010-00-01 2010-10-00 3000-01-01 4000-01-01 5000-01-01 6000-01-01 7000-01-01 8000-01-01 9000-01-01 9000-01-01 9999-12-31 9999-12-31 SELECT * FROM t2 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 = '9999-12-31' ORDER BY c1,c2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 = '9999-12-31' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 = '9999-12-31' ORDER BY c1,c2 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 = '9999-12-31' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 <> '9999-12-31' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t2 WHERE c2 <> '9999-12-31' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 > '9999-12-31' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 > '9999-12-31' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 >= '9999-12-31' ORDER BY c1,c2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 >= '9999-12-31' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 < '9999-12-31' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t2 WHERE c2 < '9999-12-31' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <= '9999-12-31' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 <= '9999-12-31' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <=> '9999-12-31' ORDER BY c1,c2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 <=> '9999-12-31' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 BETWEEN '1000-00-01' AND '9999-12-31' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 BETWEEN '1000-00-01' AND '9999-12-31' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t2 WHERE c2 IN ('1000-00-01','9999-12-31') ORDER BY c1,c2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 IN ('1000-00-01','9999-12-31') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 >= '1000-00-01' AND c2 < '9999-12-31' AND c1 = '9999-12-31' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 >= '1000-00-01' AND c2 < '9999-12-31' AND c1 = '9999-12-31' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <> '9999-12-31' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t2 WHERE c2 <> '9999-12-31' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 > '9999-12-31' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 > '9999-12-31' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 >= '9999-12-31' ORDER BY c1,c2 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 >= '9999-12-31' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 < '9999-12-31' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t2 WHERE c2 < '9999-12-31' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <= '9999-12-31' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 <= '9999-12-31' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <=> '9999-12-31' ORDER BY c1,c2 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 <=> '9999-12-31' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 BETWEEN '1000-00-01' AND '9999-12-31' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 BETWEEN '1000-00-01' AND '9999-12-31' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t2 WHERE c2 IN ('1000-00-01','9999-12-31') ORDER BY c1,c2 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 IN ('1000-00-01','9999-12-31') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 >= '1000-00-01' AND c2 < '9999-12-31' AND c1 = '9999-12-31' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 >= '1000-00-01' AND c2 < '9999-12-31' AND c1 = '9999-12-31' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t2; total_rows min_value max(c2) 21 0000-00-00 9999-12-31 SELECT * FROM t2 WHERE c4 = '2008-01-07'; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT c1,c2 FROM t2; c1 c2 0000-00-00 0000-00-00 0000-00-00 2008-01-06 1000-01-01 2000-01-01 1983-09-05 1983-09-05 1983-09-09 1983-09-10 1998-12-28 1998-12-28 1998-12-29 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-30 1998-12-31 1998-12-30 1998-12-31 1998-12-31 1999-01-01 1999-01-01 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2009-01-29 2009-01-29 2010-00-01 2010-10-00 3000-01-01 4000-01-01 5000-01-01 6000-01-01 7000-01-01 8000-01-01 9000-01-01 9000-01-01 9999-12-31 9999-12-31 SELECT c1,c2 FROM t2 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 2008-01-06 0000-00-00 0000-00-00 1000-01-01 2000-01-01 1983-09-05 1983-09-05 1983-09-09 1983-09-10 1998-12-28 1998-12-28 1998-12-29 1998-12-30 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-31 1998-12-31 1998-12-31 1998-12-30 1999-01-01 1999-01-01 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2009-01-29 2009-01-29 2010-00-01 2010-10-00 3000-01-01 4000-01-01 5000-01-01 6000-01-01 7000-01-01 8000-01-01 9000-01-01 9000-01-01 9999-12-31 9999-12-31 SELECT * FROM t2 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 = '2010-10-00' ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 = '2010-10-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 = '2010-10-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 = '2010-10-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 <> '2010-10-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 <> '2010-10-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 > '2010-10-00' ORDER BY c1,c2; c1 c2 c3 c4 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 > '2010-10-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 >= '2010-10-00' ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 >= '2010-10-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 SELECT * FROM t2 WHERE c2 < '2010-10-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 < '2010-10-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <= '2010-10-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 <= '2010-10-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <=> '2010-10-00' ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 <=> '2010-10-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 BETWEEN '1000-00-01' AND '2010-10-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 BETWEEN '1000-00-01' AND '2010-10-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t2 WHERE c2 IN ('1000-00-01','2010-10-00') ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 IN ('1000-00-01','2010-10-00') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 >= '1000-00-01' AND c2 < '2010-10-00' AND c1 = '2010-00-01' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 >= '1000-00-01' AND c2 < '2010-10-00' AND c1 = '2010-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <> '2010-10-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 <> '2010-10-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 > '2010-10-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 > '2010-10-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 >= '2010-10-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 >= '2010-10-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 SELECT * FROM t2 WHERE c2 < '2010-10-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 < '2010-10-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <= '2010-10-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 <= '2010-10-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <=> '2010-10-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 <=> '2010-10-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 BETWEEN '1000-00-01' AND '2010-10-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 BETWEEN '1000-00-01' AND '2010-10-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t2 WHERE c2 IN ('1000-00-01','2010-10-00') ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 IN ('1000-00-01','2010-10-00') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 >= '1000-00-01' AND c2 < '2010-10-00' AND c1 = '2010-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 >= '1000-00-01' AND c2 < '2010-10-00' AND c1 = '2010-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 1999-01-01 NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 2008-01-06 2008-01-06 00:00:00 2008-01-07 00:00:00 0000-00-00 0000-00-00 2008-01-06 00:00:00 2008-01-07 00:00:00 SELECT * FROM t3; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t3; total_rows min_value max(c1) 22 0000-00-00 9999-12-31 SELECT * FROM t3 WHERE c3 = '2007-05-24 09:15:28'; c1 c2 c3 c4 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 SELECT c1,c2 FROM t3; c1 c2 0000-00-00 0000-00-00 1000-01-01 2000-01-01 1983-09-05 1983-09-05 1983-09-09 1983-09-10 1998-12-28 1998-12-28 1998-12-29 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-30 1998-12-31 1998-12-30 1998-12-31 1998-12-31 1999-01-01 NULL 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2008-01-01 NULL 2008-01-06 0000-00-00 2009-01-29 2009-01-29 2010-00-01 2010-10-00 3000-01-01 4000-01-01 5000-01-01 6000-01-01 7000-01-01 8000-01-01 9000-01-01 9000-01-01 9999-12-31 9999-12-31 SELECT c1,c2 FROM t3 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 0000-00-00 1000-01-01 2000-01-01 1983-09-05 1983-09-05 1983-09-09 1983-09-10 1998-12-28 1998-12-28 1998-12-29 1998-12-30 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-31 1998-12-31 1998-12-31 1998-12-30 1999-01-01 NULL 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2008-01-01 NULL 2008-01-06 0000-00-00 2009-01-29 2009-01-29 2010-00-01 2010-10-00 3000-01-01 4000-01-01 5000-01-01 6000-01-01 7000-01-01 8000-01-01 9000-01-01 9000-01-01 9999-12-31 9999-12-31 SELECT * FROM t3 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 = '1000-00-01' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 = '1000-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 = '1000-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 = '1000-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 <> '1000-00-01' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 <> '1000-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 > '1000-00-01' ORDER BY c1,c2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 > '1000-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 >= '1000-00-01' ORDER BY c1,c2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 >= '1000-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 < '1000-00-01' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 < '1000-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <= '1000-00-01' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <= '1000-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <=> '1000-00-01' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 <=> '1000-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 BETWEEN '1000-00-01' AND '9999-12-31' ORDER BY c1,c2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '1000-00-01' AND '9999-12-31' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 IN ('1000-00-01','9999-12-31') ORDER BY c1,c2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 IN ('1000-00-01','9999-12-31') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 >= '1000-00-01' AND c1 < '9999-12-31' AND c2 = '1000-00-01' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 >= '1000-00-01' AND c1 < '9999-12-31' AND c2 = '1000-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 <> '1000-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 <> '1000-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 > '1000-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 > '1000-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 >= '1000-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 >= '1000-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 < '1000-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 < '1000-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <= '1000-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <= '1000-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <=> '1000-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 <=> '1000-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 BETWEEN '1000-00-01' AND '9999-12-31' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '1000-00-01' AND '9999-12-31' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 IN ('1000-00-01','9999-12-31') ORDER BY c1,c2 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 IN ('1000-00-01','9999-12-31') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 >= '1000-00-01' AND c1 < '9999-12-31' AND c2 = '1000-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 >= '1000-00-01' AND c1 < '9999-12-31' AND c2 = '1000-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t3; total_rows min_value max(c1) 22 0000-00-00 9999-12-31 SELECT * FROM t3 WHERE c3 = '2007-05-26 00:00:00'; c1 c2 c3 c4 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 SELECT c1,c2 FROM t3; c1 c2 0000-00-00 0000-00-00 1000-01-01 2000-01-01 1983-09-05 1983-09-05 1983-09-09 1983-09-10 1998-12-28 1998-12-28 1998-12-29 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-30 1998-12-31 1998-12-30 1998-12-31 1998-12-31 1999-01-01 NULL 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2008-01-01 NULL 2008-01-06 0000-00-00 2009-01-29 2009-01-29 2010-00-01 2010-10-00 3000-01-01 4000-01-01 5000-01-01 6000-01-01 7000-01-01 8000-01-01 9000-01-01 9000-01-01 9999-12-31 9999-12-31 SELECT c1,c2 FROM t3 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 0000-00-00 1000-01-01 2000-01-01 1983-09-05 1983-09-05 1983-09-09 1983-09-10 1998-12-28 1998-12-28 1998-12-29 1998-12-30 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-31 1998-12-31 1998-12-31 1998-12-30 1999-01-01 NULL 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2008-01-01 NULL 2008-01-06 0000-00-00 2009-01-29 2009-01-29 2010-00-01 2010-10-00 3000-01-01 4000-01-01 5000-01-01 6000-01-01 7000-01-01 8000-01-01 9000-01-01 9000-01-01 9999-12-31 9999-12-31 SELECT * FROM t3 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 = '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 = '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 = '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 = '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <> '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 <> '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 > '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 > '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 < '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 < '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 <= '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <= '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '9999-12-31' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '9999-12-31' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','9999-12-31') ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','9999-12-31') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '9999-12-31' AND c2 = '2010-10-00' ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '9999-12-31' AND c2 = '2010-10-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 <> '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 <> '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 > '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 > '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 < '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 < '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 <= '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <= '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '9999-12-31' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '9999-12-31' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','9999-12-31') ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','9999-12-31') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '9999-12-31' AND c2 = '2010-10-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '9999-12-31' AND c2 = '2010-10-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t3; total_rows min_value max(c1) 22 0000-00-00 9999-12-31 SELECT * FROM t3 WHERE c3 = '1998-12-28 00:00:00'; c1 c2 c3 c4 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 SELECT c1,c2 FROM t3; c1 c2 0000-00-00 0000-00-00 1000-01-01 2000-01-01 1983-09-05 1983-09-05 1983-09-09 1983-09-10 1998-12-28 1998-12-28 1998-12-29 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-30 1998-12-31 1998-12-30 1998-12-31 1998-12-31 1999-01-01 NULL 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2008-01-01 NULL 2008-01-06 0000-00-00 2009-01-29 2009-01-29 2010-00-01 2010-10-00 3000-01-01 4000-01-01 5000-01-01 6000-01-01 7000-01-01 8000-01-01 9000-01-01 9000-01-01 9999-12-31 9999-12-31 SELECT c1,c2 FROM t3 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 0000-00-00 1000-01-01 2000-01-01 1983-09-05 1983-09-05 1983-09-09 1983-09-10 1998-12-28 1998-12-28 1998-12-29 1998-12-30 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-31 1998-12-31 1998-12-31 1998-12-30 1999-01-01 NULL 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2008-01-01 NULL 2008-01-06 0000-00-00 2009-01-29 2009-01-29 2010-00-01 2010-10-00 3000-01-01 4000-01-01 5000-01-01 6000-01-01 7000-01-01 8000-01-01 9000-01-01 9000-01-01 9999-12-31 9999-12-31 SELECT * FROM t3 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 = '2010-00-01' ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 = '2010-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 = '2010-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 = '2010-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 <> '2010-00-01' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 <> '2010-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 > '2010-00-01' ORDER BY c1,c2; c1 c2 c3 c4 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 > '2010-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 >= '2010-00-01' ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 >= '2010-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 SELECT * FROM t3 WHERE c1 < '2010-00-01' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 < '2010-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 <= '2010-00-01' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 <= '2010-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 <=> '2010-00-01' ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 <=> '2010-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','2010-00-01') ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','2010-00-01') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01' AND c2 = '2010-10-00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01' AND c2 = '2010-10-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 <> '2010-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 <> '2010-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 > '2010-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 > '2010-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 >= '2010-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 >= '2010-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 SELECT * FROM t3 WHERE c1 < '2010-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 < '2010-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 <= '2010-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 <= '2010-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 <=> '2010-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 <=> '2010-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','2010-00-01') ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','2010-00-01') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01' AND c2 = '2010-10-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01' AND c2 = '2010-10-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t3; total_rows min_value max(c2) 22 0000-00-00 9999-12-31 SELECT * FROM t3 WHERE c4 = '2009-01-29'; c1 c2 c3 c4 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT c1,c2 FROM t3; c1 c2 0000-00-00 0000-00-00 1000-01-01 2000-01-01 1983-09-05 1983-09-05 1983-09-09 1983-09-10 1998-12-28 1998-12-28 1998-12-29 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-30 1998-12-31 1998-12-30 1998-12-31 1998-12-31 1999-01-01 NULL 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2008-01-01 NULL 2008-01-06 0000-00-00 2009-01-29 2009-01-29 2010-00-01 2010-10-00 3000-01-01 4000-01-01 5000-01-01 6000-01-01 7000-01-01 8000-01-01 9000-01-01 9000-01-01 9999-12-31 9999-12-31 SELECT c1,c2 FROM t3 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 0000-00-00 1000-01-01 2000-01-01 1983-09-05 1983-09-05 1983-09-09 1983-09-10 1998-12-28 1998-12-28 1998-12-29 1998-12-30 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-31 1998-12-31 1998-12-31 1998-12-30 1999-01-01 NULL 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2008-01-01 NULL 2008-01-06 0000-00-00 2009-01-29 2009-01-29 2010-00-01 2010-10-00 3000-01-01 4000-01-01 5000-01-01 6000-01-01 7000-01-01 8000-01-01 9000-01-01 9000-01-01 9999-12-31 9999-12-31 SELECT * FROM t3 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 = '9999-12-31' ORDER BY c1,c2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 = '9999-12-31' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 = '9999-12-31' ORDER BY c1,c2 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 = '9999-12-31' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 <> '9999-12-31' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t3 WHERE c2 <> '9999-12-31' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 > '9999-12-31' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 > '9999-12-31' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 >= '9999-12-31' ORDER BY c1,c2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 >= '9999-12-31' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 < '9999-12-31' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t3 WHERE c2 < '9999-12-31' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 <= '9999-12-31' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 <= '9999-12-31' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 <=> '9999-12-31' ORDER BY c1,c2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 <=> '9999-12-31' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 BETWEEN '1000-00-01' AND '9999-12-31' ORDER BY c1,c2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 BETWEEN '1000-00-01' AND '9999-12-31' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 IN ('1000-00-01','9999-12-31') ORDER BY c1,c2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 IN ('1000-00-01','9999-12-31') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 >= '1000-00-01' AND c2 < '9999-12-31' AND c1 = '9999-12-31' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 >= '1000-00-01' AND c2 < '9999-12-31' AND c1 = '9999-12-31' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 1999-01-01 NULL NULL 2009-01-29 11:11:27 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1999-01-01 NULL NULL 2009-01-29 11:11:27 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 <> '9999-12-31' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t3 WHERE c2 <> '9999-12-31' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 > '9999-12-31' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 > '9999-12-31' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 >= '9999-12-31' ORDER BY c1,c2 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 >= '9999-12-31' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 < '9999-12-31' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 SELECT * FROM t3 WHERE c2 < '9999-12-31' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 <= '9999-12-31' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 <= '9999-12-31' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 <=> '9999-12-31' ORDER BY c1,c2 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 <=> '9999-12-31' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 BETWEEN '1000-00-01' AND '9999-12-31' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 BETWEEN '1000-00-01' AND '9999-12-31' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 IN ('1000-00-01','9999-12-31') ORDER BY c1,c2 DESC; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 IN ('1000-00-01','9999-12-31') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 >= '1000-00-01' AND c2 < '9999-12-31' AND c1 = '9999-12-31' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 >= '1000-00-01' AND c2 < '9999-12-31' AND c1 = '9999-12-31' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 1999-01-01 NULL NULL 2009-01-29 11:11:27 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1999-01-01 NULL NULL 2009-01-29 11:11:27 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 NULL NULL 2009-01-29 11:11:27 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t3; total_rows min_value max(c2) 22 0000-00-00 9999-12-31 SELECT * FROM t3 WHERE c4 = '2008-01-09'; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 SELECT c1,c2 FROM t3; c1 c2 0000-00-00 0000-00-00 1000-01-01 2000-01-01 1983-09-05 1983-09-05 1983-09-09 1983-09-10 1998-12-28 1998-12-28 1998-12-29 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-30 1998-12-31 1998-12-30 1998-12-31 1998-12-31 1999-01-01 NULL 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2008-01-01 NULL 2008-01-06 0000-00-00 2009-01-29 2009-01-29 2010-00-01 2010-10-00 3000-01-01 4000-01-01 5000-01-01 6000-01-01 7000-01-01 8000-01-01 9000-01-01 9000-01-01 9999-12-31 9999-12-31 SELECT c1,c2 FROM t3 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 0000-00-00 1000-01-01 2000-01-01 1983-09-05 1983-09-05 1983-09-09 1983-09-10 1998-12-28 1998-12-28 1998-12-29 1998-12-30 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-31 1998-12-31 1998-12-31 1998-12-30 1999-01-01 NULL 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2008-01-01 NULL 2008-01-06 0000-00-00 2009-01-29 2009-01-29 2010-00-01 2010-10-00 3000-01-01 4000-01-01 5000-01-01 6000-01-01 7000-01-01 8000-01-01 9000-01-01 9000-01-01 9999-12-31 9999-12-31 SELECT * FROM t3 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 = '2010-10-00' ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 = '2010-10-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 = '2010-10-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 = '2010-10-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 <> '2010-10-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 <> '2010-10-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 > '2010-10-00' ORDER BY c1,c2; c1 c2 c3 c4 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 > '2010-10-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 >= '2010-10-00' ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 >= '2010-10-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 SELECT * FROM t3 WHERE c2 < '2010-10-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 < '2010-10-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 <= '2010-10-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 <= '2010-10-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 <=> '2010-10-00' ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 <=> '2010-10-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 BETWEEN '1000-00-01' AND '2010-10-00' ORDER BY c1,c2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 BETWEEN '1000-00-01' AND '2010-10-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 IN ('1000-00-01','2010-10-00') ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 IN ('1000-00-01','2010-10-00') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 >= '1000-00-01' AND c2 < '2010-10-00' AND c1 = '2010-00-01' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 >= '1000-00-01' AND c2 < '2010-10-00' AND c1 = '2010-00-01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 1999-01-01 NULL NULL 2009-01-29 11:11:27 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1999-01-01 NULL NULL 2009-01-29 11:11:27 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 <> '2010-10-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 <> '2010-10-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 > '2010-10-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 > '2010-10-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 >= '2010-10-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 >= '2010-10-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 SELECT * FROM t3 WHERE c2 < '2010-10-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 < '2010-10-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 <= '2010-10-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 <= '2010-10-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 <=> '2010-10-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 <=> '2010-10-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 BETWEEN '1000-00-01' AND '2010-10-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 BETWEEN '1000-00-01' AND '2010-10-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 IN ('1000-00-01','2010-10-00') ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 IN ('1000-00-01','2010-10-00') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 >= '1000-00-01' AND c2 < '2010-10-00' AND c1 = '2010-00-01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 >= '1000-00-01' AND c2 < '2010-10-00' AND c1 = '2010-00-01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 1999-01-01 NULL NULL 2009-01-29 11:11:27 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1999-01-01 NULL NULL 2009-01-29 11:11:27 2008-01-01 NULL 2008-01-02 00:00:00 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 1983-09-05 1983-09-05 1983-09-06 13:28:00 1983-09-06 13:28:00 1983-09-09 1983-09-10 1983-09-08 00:00:00 2009-01-29 11:11:27 1998-12-28 1998-12-28 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-29 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-30 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 2007-05-23 2007-05-24 09:15:28 2007-05-24 09:15:28 2007-05-25 2007-05-25 2007-05-26 00:00:00 2007-05-26 00:00:00 2008-01-06 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 2009-01-29 2009-01-29 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 2010-10-00 NULL 2009-01-29 11:11:27 3000-01-01 4000-01-01 2009-01-03 00:00:00 2009-01-04 00:00:00 5000-01-01 6000-01-01 2009-01-05 00:00:00 2009-01-06 00:00:00 7000-01-01 8000-01-01 2009-01-07 00:00:00 2009-01-08 00:00:00 9000-01-01 9000-01-01 2009-01-09 00:00:00 2009-01-10 00:00:00 9999-12-31 9999-12-31 2009-01-11 00:00:00 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 0000-00-00 2008-01-08 00:00:00 2008-01-09 00:00:00 1000-01-01 2000-01-01 2009-01-01 00:00:00 2009-01-02 00:00:00 SELECT c1 FROM t3 GROUP BY c1; c1 0000-00-00 1000-01-01 1983-09-05 1983-09-09 1998-12-28 1998-12-29 1998-12-30 1998-12-31 1999-01-01 2007-05-23 2007-05-25 2008-01-01 2008-01-06 2009-01-29 2010-00-01 3000-01-01 5000-01-01 7000-01-01 9000-01-01 9999-12-31 SELECT DISTINCT c1 FROM t3; c1 0000-00-00 1000-01-01 1983-09-05 1983-09-09 1998-12-28 1998-12-29 1998-12-30 1998-12-31 1999-01-01 2007-05-23 2007-05-25 2008-01-01 2008-01-06 2009-01-29 2010-00-01 3000-01-01 5000-01-01 7000-01-01 9000-01-01 9999-12-31 SELECT c1,MIN(c2) FROM t3 GROUP BY c1; c1 MIN(c2) 0000-00-00 0000-00-00 1000-01-01 2000-01-01 1983-09-05 1983-09-05 1983-09-09 1983-09-10 1998-12-28 1998-12-28 1998-12-29 1998-12-29 1998-12-30 1998-12-30 1998-12-31 1998-12-30 1999-01-01 NULL 2007-05-23 2007-05-23 2007-05-25 2007-05-25 2008-01-01 NULL 2008-01-06 0000-00-00 2009-01-29 2009-01-29 2010-00-01 2010-10-00 3000-01-01 4000-01-01 5000-01-01 6000-01-01 7000-01-01 8000-01-01 9000-01-01 9000-01-01 9999-12-31 9999-12-31 DROP TABLE t1,t2,t3,t4; CREATE TABLE t1(c1 DATETIME NOT NULL, c2 DATETIME NULL, c3 DATE, c4 TIMESTAMP, PRIMARY KEY(c1), UNIQUE INDEX(c2)); CREATE TABLE t2(c1 DATETIME NOT NULL, c2 DATETIME NULL, c3 DATE, c4 TIMESTAMP, PRIMARY KEY(c1,c2)); CREATE TABLE t3(c1 DATETIME NOT NULL, c2 DATETIME NULL, c3 DATE, c4 TIMESTAMP, UNIQUE INDEX idx(c1,c2)); CREATE TABLE t4(c1 DATETIME NOT NULL, c2 DATETIME NULL, c3 DATE, c4 TIMESTAMP); INSERT INTO t1 VALUES('98-12-31 11:30:45','98.12.31 11+30+45','98-12-31 11:30:45','98.12.31 11+30+45'),('98/12/30 11*30*45','98@12@30 11^30^45','98/12/30 11*30*45','98@12@30 11^30^45'),('98-12-29','98.12.29','98-12-29','98.12.29'),('98/12/28','98@12@28','98/12/28','98@12@28'); Warnings: Note 1265 Data truncated for column 'c3' at row 1 Note 1265 Data truncated for column 'c3' at row 2 INSERT INTO t2 VALUES('98-12-31 11:30:45','98.12.31 11+30+45','98-12-31 11:30:45','98.12.31 11+30+45'),('98/12/30 11*30*45','98@12@30 11^30^45','98/12/30 11*30*45','98@12@30 11^30^45'),('98-12-29','98.12.29','98-12-29','98.12.29'),('98/12/28','98@12@28','98/12/28','98@12@28'); Warnings: Note 1265 Data truncated for column 'c3' at row 1 Note 1265 Data truncated for column 'c3' at row 2 INSERT INTO t3 VALUES('98-12-31 11:30:45','98.12.31 11+30+45','98-12-31 11:30:45','98.12.31 11+30+45'),('98/12/30 11*30*45','98@12@30 11^30^45','98/12/30 11*30*45','98@12@30 11^30^45'),('98-12-29','98.12.29','98-12-29','98.12.29'),('98/12/28','98@12@28','98/12/28','98@12@28'); Warnings: Note 1265 Data truncated for column 'c3' at row 1 Note 1265 Data truncated for column 'c3' at row 2 INSERT INTO t4 VALUES('98-12-31 11:30:45','98.12.31 11+30+45','98-12-31 11:30:45','98.12.31 11+30+45'),('98/12/30 11*30*45','98@12@30 11^30^45','98/12/30 11*30*45','98@12@30 11^30^45'),('98-12-29','98.12.29','98-12-29','98.12.29'),('98/12/28','98@12@28','98/12/28','98@12@28'); Warnings: Note 1265 Data truncated for column 'c3' at row 1 Note 1265 Data truncated for column 'c3' at row 2 INSERT INTO t1 VALUES('20070523091528','070523091528','20070524091528','070524091528'),('20070525','070525','20070526','070526'); Warnings: Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t2 VALUES('20070523091528','070523091528','20070524091528','070524091528'),('20070525','070525','20070526','070526'); Warnings: Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t3 VALUES('20070523091528','070523091528','20070524091528','070524091528'),('20070525','070525','20070526','070526'); Warnings: Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t4 VALUES('20070523091528','070523091528','20070524091528','070524091528'),('20070525','070525','20070526','070526'); Warnings: Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 VALUES(19830905132800,830905132800,19830906132800,830906132800),(19830907,830907,19830908,830908); Warnings: Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t2 VALUES(19830905132800,830905132800,19830906132800,830906132800),(19830907,830907,19830908,830908); Warnings: Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t3 VALUES(19830905132800,830905132800,19830906132800,830906132800),(19830907,830907,19830908,830908); Warnings: Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t4 VALUES(19830905132800,830905132800,19830906132800,830906132800),(19830907,830907,19830908,830908); Warnings: Note 1265 Data truncated for column 'c3' at row 1 SET TIMESTAMP=1233216687; INSERT INTO t1 VALUES(NOW(),CURRENT_DATE,NOW(),CURRENT_DATE); Warnings: Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t2 VALUES(NOW(),CURRENT_DATE,NOW(),CURRENT_DATE); Warnings: Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t3 VALUES(NOW(),CURRENT_DATE,NOW(),CURRENT_DATE); Warnings: Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t4 VALUES(NOW(),CURRENT_DATE,NOW(),CURRENT_DATE); Warnings: Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t2 VALUES('98-12-31 11:30:45','98@12@30 11^30^45','98-12-31 11:30:45','98.12.31 11+30+45'),('98-12-29','98@12@30 11^30^45','98/12/30 11*30*45','98@12@30 11^30^45'); Warnings: Note 1265 Data truncated for column 'c3' at row 1 Note 1265 Data truncated for column 'c3' at row 2 INSERT INTO t3 VALUES('98-12-31 11:30:45','98@12@30 11^30^45','98-12-31 11:30:45','98.12.31 11+30+45'),('98-12-29','98@12@30 11^30^45','98/12/30 11*30*45','98@12@30 11^30^45'); Warnings: Note 1265 Data truncated for column 'c3' at row 1 Note 1265 Data truncated for column 'c3' at row 2 INSERT INTO t1 VALUES('2008-01-01',NULL,'08-01-02','08/01/03'); INSERT INTO t3 VALUES('2008-01-01',NULL,'08-01-02','08/01/03'); INSERT INTO t4 VALUES('2008-01-01',NULL,'08-01-02','08/01/03'); INSERT INTO t1(c1,c2) VALUES('08/01/17',NULL); DELETE FROM t1 WHERE c1='08/01/17' AND c2 IS NULL; INSERT INTO t1 VALUES('','','08-01-04','08/01/05') /* Inserts zero dates for '' strings */; Warnings: Warning 1264 Out of range value for column 'c1' at row 1 Warning 1264 Out of range value for column 'c2' at row 1 INSERT INTO t2 VALUES('2008-04-31','2008-04-31','08-01-06','08/01/07') /* Inserts zero dates for invalid dates */; Warnings: Warning 1264 Out of range value for column 'c1' at row 1 Warning 1264 Out of range value for column 'c2' at row 1 INSERT INTO t3 VALUES('10:45:15','10:45:15','08-01-08','08/1/9') /* Inserts zero dates for invalid dates */; Warnings: Warning 1264 Out of range value for column 'c1' at row 1 Warning 1264 Out of range value for column 'c2' at row 1 INSERT INTO t2 VALUES('0000-00-00','08-01-06','08-01-06','08/01/07'); INSERT INTO t3 VALUES('08-01-06','00-00-00','08-01-08','08/1/9'); INSERT INTO t4 VALUES('abcd','abcd','08-01-10','08/01/11'),(1234,1234,'08-01-12','08/01/13') /* Inserts zero dates for absurd dates */; Warnings: Warning 1264 Out of range value for column 'c1' at row 1 Warning 1264 Out of range value for column 'c2' at row 1 Warning 1264 Out of range value for column 'c1' at row 2 Warning 1264 Out of range value for column 'c2' at row 2 SELECT * FROM t1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t4; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-10 2008-01-11 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-12 2008-01-13 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t1; total_rows min_value max(c1) 11 0000-00-00 00:00:00 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c3 = '2007-05-24'; c1 c2 c3 c4 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT c1 FROM t1; c1 0000-00-00 00:00:00 1983-09-05 13:28:00 1983-09-07 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-25 00:00:00 2008-01-01 00:00:00 2009-01-29 11:11:27 SELECT c1 FROM t1 ORDER BY c1 DESC; c1 2009-01-29 11:11:27 2008-01-01 00:00:00 2007-05-25 00:00:00 2007-05-23 09:15:28 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-05 13:28:00 0000-00-00 00:00:00 SELECT * FROM t1 ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c1 = '1998-12-31 11:30:45' ORDER BY c1; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c1 = '1998-12-31 11:30:45' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c1 = '1998-12-31 11:30:45' ORDER BY c1 DESC; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c1 = '1998-12-31 11:30:45' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c1 <> '1998-12-31 11:30:45' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 <> '1998-12-31 11:30:45' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 > '1998-12-31 11:30:45' ORDER BY c1; c1 c2 c3 c4 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 > '1998-12-31 11:30:45' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT * FROM t1 WHERE c1 >= '1998-12-31 11:30:45' ORDER BY c1; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 >= '1998-12-31 11:30:45' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t1 WHERE c1 < '1998-12-31 11:30:45' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t1 WHERE c1 < '1998-12-31 11:30:45' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 <= '1998-12-31 11:30:45' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c1 <= '1998-12-31 11:30:45' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 <=> '1998-12-31 11:30:45' ORDER BY c1; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c1 <=> '1998-12-31 11:30:45' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00 00:00:00' AND '1998-12-29 00:00:00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00 00:00:00' AND '1998-12-29 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00 00:00:00','1998-12-29 00:00:00') ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00 00:00:00','1998-12-29 00:00:00') ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00 00:00:00' AND c1 < '1998-12-29 00:00:00' AND c2 = '1983-09-07 00:00:00' ORDER BY c1; c1 c2 c3 c4 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00 00:00:00' AND c1 < '1998-12-29 00:00:00' AND c2 = '1983-09-07 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 <> '1998-12-31 11:30:45' ORDER BY c1 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <> '1998-12-31 11:30:45' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c1 > '1998-12-31 11:30:45' ORDER BY c1 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t1 WHERE c1 > '1998-12-31 11:30:45' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c1 >= '1998-12-31 11:30:45' ORDER BY c1 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c1 >= '1998-12-31 11:30:45' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c1 < '1998-12-31 11:30:45' ORDER BY c1 DESC; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 < '1998-12-31 11:30:45' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t1 WHERE c1 <= '1998-12-31 11:30:45' ORDER BY c1 DESC; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <= '1998-12-31 11:30:45' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t1 WHERE c1 <=> '1998-12-31 11:30:45' ORDER BY c1 DESC; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c1 <=> '1998-12-31 11:30:45' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00 00:00:00' AND '1998-12-29 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00 00:00:00' AND '1998-12-29 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00 00:00:00','1998-12-29 00:00:00') ORDER BY c1 DESC; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00 00:00:00','1998-12-29 00:00:00') ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00 00:00:00' AND c1 < '1998-12-29 00:00:00' AND c2 = '1983-09-07 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00 00:00:00' AND c1 < '1998-12-29 00:00:00' AND c2 = '1983-09-07 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t1; total_rows min_value max(c1) 11 0000-00-00 00:00:00 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c3 = '2007-05-26'; c1 c2 c3 c4 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT c1 FROM t1; c1 0000-00-00 00:00:00 1983-09-05 13:28:00 1983-09-07 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-25 00:00:00 2008-01-01 00:00:00 2009-01-29 11:11:27 SELECT c1 FROM t1 ORDER BY c1 DESC; c1 2009-01-29 11:11:27 2008-01-01 00:00:00 2007-05-25 00:00:00 2007-05-23 09:15:28 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-05 13:28:00 0000-00-00 00:00:00 SELECT * FROM t1 ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c1 = '0000-00-00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 = '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 = '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 = '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <> '0000-00-00' ORDER BY c1; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 <> '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t1 WHERE c1 > '0000-00-00' ORDER BY c1; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 > '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 < '0000-00-00' ORDER BY c1; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 < '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 <= '0000-00-00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <= '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <=> '0000-00-00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <=> '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '1998-12-31 11:30:45' ORDER BY c1; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '1998-12-31 11:30:45' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 <> '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 <> '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c1 > '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 > '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c1 < '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 < '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 <= '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <= '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <=> '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <=> '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1 DESC; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '1998-12-31 11:30:45' ORDER BY c1 DESC; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '1998-12-31 11:30:45' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t1; total_rows min_value max(c2) 11 0000-00-00 00:00:00 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c4 = '2007-05-26 00:00:00'; c1 c2 c3 c4 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT c2 FROM t1; c2 0000-00-00 00:00:00 1983-09-05 13:28:00 1983-09-07 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-25 00:00:00 2009-01-29 00:00:00 NULL SELECT c2 FROM t1 ORDER BY c2 DESC; c2 2009-01-29 00:00:00 2007-05-25 00:00:00 2007-05-23 09:15:28 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-05 13:28:00 0000-00-00 00:00:00 NULL SELECT * FROM t1 ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT * FROM t1 WHERE c2 = '1998-12-30 11:30:45' ORDER BY c2; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t1 WHERE c2 = '1998-12-30 11:30:45' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t1 WHERE c2 = '1998-12-30 11:30:45' ORDER BY c2 DESC; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t1 WHERE c2 = '1998-12-30 11:30:45' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t1 WHERE c2 <> '1998-12-30 11:30:45' ORDER BY c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c2 <> '1998-12-30 11:30:45' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 > '1998-12-30 11:30:45' ORDER BY c2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c2 > '1998-12-30 11:30:45' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t1 WHERE c2 >= '1998-12-30 11:30:45' ORDER BY c2; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c2 >= '1998-12-30 11:30:45' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c2 < '1998-12-30 11:30:45' ORDER BY c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t1 WHERE c2 < '1998-12-30 11:30:45' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 <= '1998-12-30 11:30:45' ORDER BY c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t1 WHERE c2 <= '1998-12-30 11:30:45' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 <=> '1998-12-30 11:30:45' ORDER BY c2; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t1 WHERE c2 <=> '1998-12-30 11:30:45' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t1 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '1998-12-31 11:30:45' ORDER BY c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '1998-12-31 11:30:45' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 IN ('0000-00-00 00:00:00','1998-12-31 11:30:45') ORDER BY c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c2 IN ('0000-00-00 00:00:00','1998-12-31 11:30:45') ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '1998-12-31 11:30:45' AND c1 = '0000-00-00 00:00:00' ORDER BY c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '1998-12-31 11:30:45' AND c1 = '0000-00-00 00:00:00' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 <> '1998-12-30 11:30:45' ORDER BY c2 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 <> '1998-12-30 11:30:45' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT * FROM t1 WHERE c2 > '1998-12-30 11:30:45' ORDER BY c2 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c2 > '1998-12-30 11:30:45' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT * FROM t1 WHERE c2 >= '1998-12-30 11:30:45' ORDER BY c2 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t1 WHERE c2 >= '1998-12-30 11:30:45' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT * FROM t1 WHERE c2 < '1998-12-30 11:30:45' ORDER BY c2 DESC; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 < '1998-12-30 11:30:45' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t1 WHERE c2 <= '1998-12-30 11:30:45' ORDER BY c2 DESC; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 <= '1998-12-30 11:30:45' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t1 WHERE c2 <=> '1998-12-30 11:30:45' ORDER BY c2 DESC; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t1 WHERE c2 <=> '1998-12-30 11:30:45' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t1 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '1998-12-31 11:30:45' ORDER BY c2 DESC; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '1998-12-31 11:30:45' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t1 WHERE c2 IN ('0000-00-00 00:00:00','1998-12-31 11:30:45') ORDER BY c2 DESC; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 IN ('0000-00-00 00:00:00','1998-12-31 11:30:45') ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '1998-12-31 11:30:45' AND c1 = '0000-00-00 00:00:00' ORDER BY c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '1998-12-31 11:30:45' AND c1 = '0000-00-00 00:00:00' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2 DESC; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT * FROM t2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t2; total_rows min_value max(c1) 13 0000-00-00 00:00:00 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c3 = '2008-01-06'; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT c1,c2 FROM t2; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT c1,c2 FROM t2 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t2 WHERE c1 = '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t2 WHERE c1 = '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t2 WHERE c1 = '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t2 WHERE c1 <> '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 <> '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 > '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 > '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t2 WHERE c1 >= '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 >= '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t2 WHERE c1 < '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t2 WHERE c1 < '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t2 WHERE c1 <= '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t2 WHERE c1 <=> '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t2 WHERE c1 BETWEEN '1983-09-07 00:00:00' AND '2007-05-23 09:15:28' ORDER BY c1,c2; c1 c2 c3 c4 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c1 BETWEEN '1983-09-07 00:00:00' AND '2007-05-23 09:15:28' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t2 WHERE c1 IN ('1983-09-07 00:00:00','2007-05-23 09:15:28') ORDER BY c1,c2; c1 c2 c3 c4 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c1 IN ('1983-09-07 00:00:00','2007-05-23 09:15:28') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c1 >= '1983-09-07 00:00:00' AND c1 < '2007-05-23 09:15:28' AND c2 = '1998-12-30 11:30:45' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t2 WHERE c1 >= '1983-09-07 00:00:00' AND c1 < '2007-05-23 09:15:28' AND c2 = '1998-12-30 11:30:45' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <> '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 <> '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 > '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 > '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t2 WHERE c1 >= '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 >= '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t2 WHERE c1 < '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t2 WHERE c1 < '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t2 WHERE c1 <= '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t2 WHERE c1 <=> '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '1983-09-07 00:00:00' AND '2007-05-23 09:15:28' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c1 BETWEEN '1983-09-07 00:00:00' AND '2007-05-23 09:15:28' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t2 WHERE c1 IN ('1983-09-07 00:00:00','2007-05-23 09:15:28') ORDER BY c1,c2 DESC; c1 c2 c3 c4 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c1 IN ('1983-09-07 00:00:00','2007-05-23 09:15:28') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c1 >= '1983-09-07 00:00:00' AND c1 < '2007-05-23 09:15:28' AND c2 = '1998-12-30 11:30:45' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t2 WHERE c1 >= '1983-09-07 00:00:00' AND c1 < '2007-05-23 09:15:28' AND c2 = '1998-12-30 11:30:45' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t2; total_rows min_value max(c1) 13 0000-00-00 00:00:00 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c3 = '1998-12-29'; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT c1,c2 FROM t2; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT c1,c2 FROM t2 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <> '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 <> '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t2 WHERE c1 > '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 > '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 < '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 < '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 <= '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '2007-05-23 09:15:28' ORDER BY c1,c2; c1 c2 c3 c4 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '2007-05-23 09:15:28' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <> '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 <> '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t2 WHERE c1 > '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 > '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 < '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 < '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 <= '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '2007-05-23 09:15:28' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '2007-05-23 09:15:28' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t2; total_rows min_value max(c2) 13 0000-00-00 00:00:00 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c4 = '2007-05-24 09:15:28'; c1 c2 c3 c4 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT c1,c2 FROM t2; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT c1,c2 FROM t2 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 = '1983-09-05 13:28:00' ORDER BY c1,c2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 = '1983-09-05 13:28:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 = '1983-09-05 13:28:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 = '1983-09-05 13:28:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 <> '1983-09-05 13:28:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 <> '1983-09-05 13:28:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 > '1983-09-05 13:28:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 > '1983-09-05 13:28:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t2 WHERE c2 >= '1983-09-05 13:28:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 >= '1983-09-05 13:28:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 < '1983-09-05 13:28:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 < '1983-09-05 13:28:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <= '1983-09-05 13:28:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 <= '1983-09-05 13:28:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 <=> '1983-09-05 13:28:00' ORDER BY c1,c2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 <=> '1983-09-05 13:28:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '2007-05-23 09:15:28' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '2007-05-23 09:15:28' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 IN ('0000-00-00 00:00:00','2007-05-23 09:15:28') ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c2 IN ('0000-00-00 00:00:00','2007-05-23 09:15:28') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '2007-05-23 09:15:28' AND c1 = '0000-00-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '2007-05-23 09:15:28' AND c1 = '0000-00-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <> '1983-09-05 13:28:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 <> '1983-09-05 13:28:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 > '1983-09-05 13:28:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 > '1983-09-05 13:28:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t2 WHERE c2 >= '1983-09-05 13:28:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 >= '1983-09-05 13:28:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 < '1983-09-05 13:28:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 < '1983-09-05 13:28:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <= '1983-09-05 13:28:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 <= '1983-09-05 13:28:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 <=> '1983-09-05 13:28:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 <=> '1983-09-05 13:28:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '2007-05-23 09:15:28' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '2007-05-23 09:15:28' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 IN ('0000-00-00 00:00:00','2007-05-23 09:15:28') ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c2 IN ('0000-00-00 00:00:00','2007-05-23 09:15:28') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '2007-05-23 09:15:28' AND c1 = '0000-00-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '2007-05-23 09:15:28' AND c1 = '0000-00-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t3; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t3; total_rows min_value max(c1) 14 0000-00-00 00:00:00 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c3 = '2007-05-24'; c1 c2 c3 c4 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT c1,c2 FROM t3; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT c1,c2 FROM t3 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 = '1998-12-28 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t3 WHERE c1 = '1998-12-28 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t3 WHERE c1 = '1998-12-28 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t3 WHERE c1 = '1998-12-28 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t3 WHERE c1 <> '1998-12-28 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 <> '1998-12-28 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 > '1998-12-28 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 > '1998-12-28 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t3 WHERE c1 >= '1998-12-28 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 >= '1998-12-28 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c1 < '1998-12-28 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t3 WHERE c1 < '1998-12-28 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 <= '1998-12-28 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t3 WHERE c1 <= '1998-12-28 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 <=> '1998-12-28 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t3 WHERE c1 <=> '1998-12-28 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '1998-12-31 11:30:45' AND '2008-01-06 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '1998-12-31 11:30:45' AND '2008-01-06 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t3 WHERE c1 IN ('1998-12-31 11:30:45','2008-01-06 00:00:00') ORDER BY c1,c2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IN ('1998-12-31 11:30:45','2008-01-06 00:00:00') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t3 WHERE c1 >= '1998-12-31 11:30:45' AND c1 < '2008-01-06 00:00:00' AND c2 = '1998-12-28 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 >= '1998-12-31 11:30:45' AND c1 < '2008-01-06 00:00:00' AND c2 = '1998-12-28 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 <> '1998-12-28 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 <> '1998-12-28 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 > '1998-12-28 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 > '1998-12-28 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c1 >= '1998-12-28 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 >= '1998-12-28 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t3 WHERE c1 < '1998-12-28 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t3 WHERE c1 < '1998-12-28 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 <= '1998-12-28 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t3 WHERE c1 <= '1998-12-28 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 <=> '1998-12-28 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t3 WHERE c1 <=> '1998-12-28 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '1998-12-31 11:30:45' AND '2008-01-06 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '1998-12-31 11:30:45' AND '2008-01-06 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t3 WHERE c1 IN ('1998-12-31 11:30:45','2008-01-06 00:00:00') ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IN ('1998-12-31 11:30:45','2008-01-06 00:00:00') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t3 WHERE c1 >= '1998-12-31 11:30:45' AND c1 < '2008-01-06 00:00:00' AND c2 = '1998-12-28 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 >= '1998-12-31 11:30:45' AND c1 < '2008-01-06 00:00:00' AND c2 = '1998-12-28 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t3; total_rows min_value max(c1) 14 0000-00-00 00:00:00 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c3 = '1998-12-29'; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT c1,c2 FROM t3; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT c1,c2 FROM t3 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 = '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 = '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 = '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 = '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <> '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 <> '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t3 WHERE c1 > '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 > '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 < '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 < '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 <= '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <= '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '1998-12-30 11:30:45' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '1998-12-30 11:30:45' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 <> '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 <> '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t3 WHERE c1 > '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 > '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 < '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 < '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 <= '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <= '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '1998-12-30 11:30:45' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '1998-12-30 11:30:45' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t3; total_rows min_value max(c2) 14 0000-00-00 00:00:00 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c4 = '2007-05-24 09:15:28'; c1 c2 c3 c4 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT c1,c2 FROM t3; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT c1,c2 FROM t3 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 = '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c2 = '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c2 = '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c2 = '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c2 <> '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 <> '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 > '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 > '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t3 WHERE c2 >= '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 >= '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t3 WHERE c2 < '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 < '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 <= '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 <= '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 <=> '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c2 <=> '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '1998-12-30 11:30:45' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '1998-12-30 11:30:45' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 IN ('0000-00-00 00:00:00','1998-12-30 11:30:45') ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 IN ('0000-00-00 00:00:00','1998-12-30 11:30:45') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t3 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '1998-12-30 11:30:45' AND c1 = '0000-00-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '1998-12-30 11:30:45' AND c1 = '0000-00-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 <> '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 <> '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 > '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 > '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t3 WHERE c2 >= '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 >= '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c2 < '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 < '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 <= '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 <= '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 <=> '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c2 <=> '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '1998-12-30 11:30:45' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '1998-12-30 11:30:45' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 IN ('0000-00-00 00:00:00','1998-12-30 11:30:45') ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 IN ('0000-00-00 00:00:00','1998-12-30 11:30:45') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t3 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '1998-12-30 11:30:45' AND c1 = '0000-00-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '1998-12-30 11:30:45' AND c1 = '0000-00-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 INSERT INTO t1(c1,c2) VALUES('20070525','070523091528') /* Row with c1='20070525' exists */; ERROR 23000: Duplicate entry '2007-05-25 00:00:00' for key 'PRIMARY' INSERT INTO t2(c1,c2) VALUES(19830907,830907) /* Row with c1=19830907,c2=830907 exists */; ERROR 23000: Duplicate entry '1983-09-07 00:00:00-1983-09-07 00:00:00' for key 'PRIMARY' INSERT INTO t1(c1,c2) VALUES(19840905,830907) /* Row with c2=830907 exists */; ERROR 23000: Duplicate entry '1983-09-07 00:00:00' for key 'c2' INSERT INTO t3(c1,c2) VALUES(19830907,830907) /* Row with c1=19830907,c2=830907 exists */; ERROR 23000: Duplicate entry '1983-09-07 00:00:00-1983-09-07 00:00:00' for key 'idx' INSERT IGNORE INTO t1(c1,c2) VALUES('20070525','20070527') /* doesn't throw error */; INSERT IGNORE INTO t2(c1,c2) VALUES(19830907,830907) /* doesn't throw error */; INSERT IGNORE INTO t1(c1,c2) VALUES(19840905,830907) /* doesn't throw error */; INSERT IGNORE INTO t3(c1,c2) VALUES(19830907,830907) /* doesn't throw error */; SELECT * FROM t1 WHERE c1='20070525' /* Returns 1 row with c1=2007-05-25 */; c1 c2 c3 c4 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT * FROM t2 WHERE c1=19830907 AND c2=830907 /* Returns 1 row with c1=1983-09-07 and c2=1983-09-07 */; c1 c2 c3 c4 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t1 WHERE c2=830907 /* Returns 1 row with c2=1983-09-07 */; c1 c2 c3 c4 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t3 WHERE c1=19830907 AND c2=830907 /* Returns 1 row with c1=1983-09-07 and c2=1983-09-07 */; c1 c2 c3 c4 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t1 WHERE c1='20070527' /* Returns no rows */; c1 c2 c3 c4 INSERT INTO t1(c1) VALUES('20070525') ON DUPLICATE KEY UPDATE c1='20070527'; SELECT * FROM t1 WHERE c1='20070527' /* Returns 1 row with c1=2007-05-27 */; c1 c2 c3 c4 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1=19830909 AND c2=830910 /* Returns no rows */; c1 c2 c3 c4 INSERT INTO t2(c1,c2) VALUES(19830907,830907) ON DUPLICATE KEY UPDATE c1=19830909,c2=830910; SELECT * FROM t2 WHERE c1=19830909 AND c2=830910 /* Returns 1 row with c1=19830909,c2=830910 */; c1 c2 c3 c4 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1=19830909 AND c2=830910 /* Returns no rows */; c1 c2 c3 c4 INSERT INTO t1(c1,c2) VALUES(19840905,830907) ON DUPLICATE KEY UPDATE c1=19830909,c2=830910; SELECT * FROM t1 WHERE c1=19830909 AND c2=830910 /* Returns 1 row */; c1 c2 c3 c4 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1=19830909 AND c2=830910 /* Returns no rows */; c1 c2 c3 c4 INSERT INTO t3(c1,c2) VALUES(19830907,830907) ON DUPLICATE KEY UPDATE c1=19830909,c2=830910; SELECT * FROM t3 WHERE c1=19830909 AND c2=830910 /* Returns 1 row */; c1 c2 c3 c4 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 INSERT INTO t1 SET c1='1999-01-01',c2='1999-01-01'; INSERT INTO t2 SET c1='1999-01-01',c2='1999-01-01'; INSERT INTO t3 SET c1='1999-01-01'; INSERT INTO t4 SET c2='1999-01-01'; Warnings: Warning 1364 Field 'c1' doesn't have a default value SELECT * FROM t1 WHERE c1='1999-01-01' AND c2='1999-01-01' /* Returns 1 row with values for other column as NULL */; c1 c2 c3 c4 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1='1999-01-01' AND c2='1999-01-01' /* Returns 1 row with values for other column as NULL */; c1 c2 c3 c4 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1='1999-01-01' /* Returns 1 row with values for other column as NULL */; c1 c2 c3 c4 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 SELECT * FROM t4 WHERE c2='1999-01-01' /* Returns 1 row with values for other column as NULL */; c1 c2 c3 c4 0000-00-00 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 CREATE TABLE t5(c1 DATETIME NOT NULL, c2 DATETIME NULL, c3 DATE, c4 TIMESTAMP, INDEX idx(c1,c2)); INSERT INTO t5 SELECT * FROM t1 WHERE c1 >=0 AND c1 < '20070523091528'; SELECT * FROM t5; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 TRUNCATE TABLE t5; INSERT INTO t5 SELECT * FROM t2 WHERE c1 >='98-12-31 11:30:45' AND c1 < '20070523091528' AND c2 <> '070525'; SELECT * FROM t5; TRUNCATE TABLE t5; INSERT INTO t5 SELECT * FROM t3 WHERE c2 BETWEEN 0 AND '1998-12-30 11:30:45'; SELECT * FROM t5; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 TRUNCATE TABLE t5; DROP TABLE t5; INSERT INTO t1 VALUES('1000-01-01 00:00:00','2000-01-01 00:00:00','2009-01-01','2009-01-02'),('3000-01-01 00:00:00','4000-01-01 00:00:00','2009-01-03','2009-01-04'),('5000-01-01 00:00:00','6000-01-01 00:00:00','2009-01-05','2009-01-06'),('7000-01-01 00:00:00','8000-01-01 00:00:00','2009-01-07','2009-01-08'),('9000-01-01 00:00:00','9000-01-01 00:00:00','2009-01-09','2009-01-10'),('9999-12-31 23:59:59','9999-12-31 23:59:59','2009-01-11','2009-01-12'); INSERT INTO t2 VALUES('1000-01-01 00:00:00','2000-01-01 00:00:00','2009-01-01','2009-01-02'),('3000-01-01 00:00:00','4000-01-01 00:00:00','2009-01-03','2009-01-04'),('5000-01-01 00:00:00','6000-01-01 00:00:00','2009-01-05','2009-01-06'),('7000-01-01 00:00:00','8000-01-01 00:00:00','2009-01-07','2009-01-08'),('9000-01-01 00:00:00','9000-01-01 00:00:00','2009-01-09','2009-01-10'),('9999-12-31 23:59:59','9999-12-31 23:59:59','2009-01-11','2009-01-12'); INSERT INTO t3 VALUES('1000-01-01 00:00:00','2000-01-01 00:00:00','2009-01-01','2009-01-02'),('3000-01-01 00:00:00','4000-01-01 00:00:00','2009-01-03','2009-01-04'),('5000-01-01 00:00:00','6000-01-01 00:00:00','2009-01-05','2009-01-06'),('7000-01-01 00:00:00','8000-01-01 00:00:00','2009-01-07','2009-01-08'),('9000-01-01 00:00:00','9000-01-01 00:00:00','2009-01-09','2009-01-10'),('9999-12-31 23:59:59','9999-12-31 23:59:59','2009-01-11','2009-01-12'); INSERT INTO t4 VALUES('1000-01-01 00:00:00','2000-01-01 00:00:00','2009-01-01','2009-01-02'),('3000-01-01 00:00:00','4000-01-01 00:00:00','2009-01-03','2009-01-04'),('5000-01-01 00:00:00','6000-01-01 00:00:00','2009-01-05','2009-01-06'),('7000-01-01 00:00:00','8000-01-01 00:00:00','2009-01-07','2009-01-08'),('9000-01-01 00:00:00','9000-01-01 00:00:00','2009-01-09','2009-01-10'),('9999-12-31 23:59:59','9999-12-31 23:59:59','2009-01-11','2009-01-12'); INSERT INTO t1(c1,c2) VALUES('2010-00-01','2010-10-00'); INSERT INTO t2(c1,c2) VALUES('2010-00-01','2010-10-00'); INSERT INTO t3(c1,c2) VALUES('2010-00-01','2010-10-00'); INSERT INTO t4(c1,c2) VALUES('2010-00-01','2010-10-00'); INSERT INTO t4(c1) VALUES('2009-02-30'),('2009-04-31'),('2009-06-31'),('2009-09-31'),('2009-11-31'),('2009-13-01'),('2009-12-32'),('2009-01-01 23:60:60'),('2009-01-01 24:59:59'),('2009-01-01 23:59:60'); Warnings: Warning 1264 Out of range value for column 'c1' at row 1 Warning 1264 Out of range value for column 'c1' at row 2 Warning 1264 Out of range value for column 'c1' at row 3 Warning 1264 Out of range value for column 'c1' at row 4 Warning 1264 Out of range value for column 'c1' at row 5 Warning 1264 Out of range value for column 'c1' at row 6 Warning 1264 Out of range value for column 'c1' at row 7 Warning 1264 Out of range value for column 'c1' at row 8 Warning 1264 Out of range value for column 'c1' at row 9 Warning 1264 Out of range value for column 'c1' at row 10 INSERT INTO t1(c1) VALUES(NULL); ERROR 23000: Column 'c1' cannot be null INSERT INTO t2(c1) VALUES(NULL); ERROR 23000: Column 'c1' cannot be null INSERT INTO t3 VALUES(NULL,'2008-01-14 00:00:00','08-01-15','08/01/16'); ERROR 23000: Column 'c1' cannot be null INSERT INTO t4 VALUES(NULL,'2008-01-14 00:00:00','08-01-15','08/01/16'); ERROR 23000: Column 'c1' cannot be null SET SQL_MODE=STRICT_ALL_TABLES; INSERT INTO t4 SET c2='1999-01-01' /* NOT NULL column will not get the default value */; ERROR HY000: Field 'c1' doesn't have a default value SET SQL_MODE=''; SELECT * FROM t1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t4; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-10 2008-01-11 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-12 2008-01-13 00:00:00 0000-00-00 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t1; total_rows min_value max(c1) 19 0000-00-00 00:00:00 9999-12-31 23:59:59 SELECT * FROM t1 WHERE c3 = '2007-05-24'; c1 c2 c3 c4 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT c1 FROM t1; c1 0000-00-00 00:00:00 1000-01-01 00:00:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 2007-05-23 09:15:28 2007-05-27 00:00:00 2008-01-01 00:00:00 2009-01-29 11:11:27 2010-00-01 00:00:00 3000-01-01 00:00:00 5000-01-01 00:00:00 7000-01-01 00:00:00 9000-01-01 00:00:00 9999-12-31 23:59:59 SELECT c1 FROM t1 ORDER BY c1 DESC; c1 9999-12-31 23:59:59 9000-01-01 00:00:00 7000-01-01 00:00:00 5000-01-01 00:00:00 3000-01-01 00:00:00 2010-00-01 00:00:00 2009-01-29 11:11:27 2008-01-01 00:00:00 2007-05-27 00:00:00 2007-05-23 09:15:28 1999-01-01 00:00:00 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-05 13:28:00 1000-01-01 00:00:00 0000-00-00 00:00:00 SELECT * FROM t1 ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c1 = '1000-00-01 00:00:00' ORDER BY c1; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 = '1000-00-01 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 = '1000-00-01 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 = '1000-00-01 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 <> '1000-00-01 00:00:00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 <> '1000-00-01 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 > '1000-00-01 00:00:00' ORDER BY c1; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 > '1000-00-01 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 >= '1000-00-01 00:00:00' ORDER BY c1; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 >= '1000-00-01 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 < '1000-00-01 00:00:00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 < '1000-00-01 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <= '1000-00-01 00:00:00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <= '1000-00-01 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <=> '1000-00-01 00:00:00' ORDER BY c1; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 <=> '1000-00-01 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 BETWEEN '1000-00-01 00:00:00' AND '9999-12-31 23:59:59' ORDER BY c1; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '1000-00-01 00:00:00' AND '9999-12-31 23:59:59' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 IN ('1000-00-01 00:00:00','9999-12-31 23:59:59') ORDER BY c1; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 IN ('1000-00-01 00:00:00','9999-12-31 23:59:59') ORDER BY c1 LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 >= '1000-00-01 00:00:00' AND c1 < '9999-12-31 23:59:59' AND c2 = '1000-00-01 00:00:00' ORDER BY c1; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 >= '1000-00-01 00:00:00' AND c1 < '9999-12-31 23:59:59' AND c2 = '1000-00-01 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 <> '1000-00-01 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <> '1000-00-01 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c1 > '1000-00-01 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 > '1000-00-01 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c1 >= '1000-00-01 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 >= '1000-00-01 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c1 < '1000-00-01 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 < '1000-00-01 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <= '1000-00-01 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <= '1000-00-01 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <=> '1000-00-01 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 <=> '1000-00-01 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 BETWEEN '1000-00-01 00:00:00' AND '9999-12-31 23:59:59' ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '1000-00-01 00:00:00' AND '9999-12-31 23:59:59' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c1 IN ('1000-00-01 00:00:00','9999-12-31 23:59:59') ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 IN ('1000-00-01 00:00:00','9999-12-31 23:59:59') ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 >= '1000-00-01 00:00:00' AND c1 < '9999-12-31 23:59:59' AND c2 = '1000-00-01 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 >= '1000-00-01 00:00:00' AND c1 < '9999-12-31 23:59:59' AND c2 = '1000-00-01 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t1; total_rows min_value max(c1) 19 0000-00-00 00:00:00 9999-12-31 23:59:59 SELECT * FROM t1 WHERE c3 = '2007-05-26'; c1 c2 c3 c4 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 SELECT c1 FROM t1; c1 0000-00-00 00:00:00 1000-01-01 00:00:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 2007-05-23 09:15:28 2007-05-27 00:00:00 2008-01-01 00:00:00 2009-01-29 11:11:27 2010-00-01 00:00:00 3000-01-01 00:00:00 5000-01-01 00:00:00 7000-01-01 00:00:00 9000-01-01 00:00:00 9999-12-31 23:59:59 SELECT c1 FROM t1 ORDER BY c1 DESC; c1 9999-12-31 23:59:59 9000-01-01 00:00:00 7000-01-01 00:00:00 5000-01-01 00:00:00 3000-01-01 00:00:00 2010-00-01 00:00:00 2009-01-29 11:11:27 2008-01-01 00:00:00 2007-05-27 00:00:00 2007-05-23 09:15:28 1999-01-01 00:00:00 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-05 13:28:00 1000-01-01 00:00:00 0000-00-00 00:00:00 SELECT * FROM t1 ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c1 = '0000-00-00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 = '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 = '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 = '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <> '0000-00-00' ORDER BY c1; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 <> '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 > '0000-00-00' ORDER BY c1; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 > '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 < '0000-00-00' ORDER BY c1; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 < '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 <= '0000-00-00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <= '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <=> '0000-00-00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <=> '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '9999-12-31 23:59:59' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '9999-12-31 23:59:59' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','9999-12-31 23:59:59') ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','9999-12-31 23:59:59') ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '9999-12-31 23:59:59' AND c2 = '2010-10-00 00:00:00' ORDER BY c1; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '9999-12-31 23:59:59' AND c2 = '2010-10-00 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 <> '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 <> '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c1 > '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 > '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c1 < '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 < '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 <= '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <= '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <=> '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <=> '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '9999-12-31 23:59:59' ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '9999-12-31 23:59:59' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','9999-12-31 23:59:59') ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','9999-12-31 23:59:59') ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '9999-12-31 23:59:59' AND c2 = '2010-10-00 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '9999-12-31 23:59:59' AND c2 = '2010-10-00 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t1; total_rows min_value max(c1) 19 0000-00-00 00:00:00 9999-12-31 23:59:59 SELECT * FROM t1 WHERE c3 = '1998-12-28'; c1 c2 c3 c4 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT c1 FROM t1; c1 0000-00-00 00:00:00 1000-01-01 00:00:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 2007-05-23 09:15:28 2007-05-27 00:00:00 2008-01-01 00:00:00 2009-01-29 11:11:27 2010-00-01 00:00:00 3000-01-01 00:00:00 5000-01-01 00:00:00 7000-01-01 00:00:00 9000-01-01 00:00:00 9999-12-31 23:59:59 SELECT c1 FROM t1 ORDER BY c1 DESC; c1 9999-12-31 23:59:59 9000-01-01 00:00:00 7000-01-01 00:00:00 5000-01-01 00:00:00 3000-01-01 00:00:00 2010-00-01 00:00:00 2009-01-29 11:11:27 2008-01-01 00:00:00 2007-05-27 00:00:00 2007-05-23 09:15:28 1999-01-01 00:00:00 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-05 13:28:00 1000-01-01 00:00:00 0000-00-00 00:00:00 SELECT * FROM t1 ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c1 = '2010-00-01 00:00:00' ORDER BY c1; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 = '2010-00-01 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 = '2010-00-01 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 = '2010-00-01 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 <> '2010-00-01 00:00:00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 <> '2010-00-01 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 > '2010-00-01 00:00:00' ORDER BY c1; c1 c2 c3 c4 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 > '2010-00-01 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c1 >= '2010-00-01 00:00:00' ORDER BY c1; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 >= '2010-00-01 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 SELECT * FROM t1 WHERE c1 < '2010-00-01 00:00:00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 < '2010-00-01 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 <= '2010-00-01 00:00:00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 <= '2010-00-01 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 <=> '2010-00-01 00:00:00' ORDER BY c1; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 <=> '2010-00-01 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01 00:00:' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01 00:00:' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','2010-00-01 00:00:') ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','2010-00-01 00:00:') ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01 00:00:' AND c2 = '2010-10-00 00:00:00' ORDER BY c1; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01 00:00:' AND c2 = '2010-10-00 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 <> '2010-00-01 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <> '2010-00-01 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c1 > '2010-00-01 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 SELECT * FROM t1 WHERE c1 > '2010-00-01 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c1 >= '2010-00-01 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 >= '2010-00-01 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c1 < '2010-00-01 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 < '2010-00-01 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c1 <= '2010-00-01 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <= '2010-00-01 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 <=> '2010-00-01 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 <=> '2010-00-01 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01 00:00:' ORDER BY c1 DESC; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01 00:00:' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','2010-00-01 00:00:') ORDER BY c1 DESC; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','2010-00-01 00:00:') ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01 00:00:' AND c2 = '2010-10-00 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01 00:00:' AND c2 = '2010-10-00 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t1; total_rows min_value max(c2) 19 0000-00-00 00:00:00 9999-12-31 23:59:59 SELECT * FROM t1 WHERE c4 = '2009-01-29'; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT c2 FROM t1; c2 0000-00-00 00:00:00 1983-09-05 13:28:00 1983-09-10 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 2000-01-01 00:00:00 2007-05-23 09:15:28 2007-05-25 00:00:00 2009-01-29 00:00:00 2010-10-00 00:00:00 4000-01-01 00:00:00 6000-01-01 00:00:00 8000-01-01 00:00:00 9000-01-01 00:00:00 9999-12-31 23:59:59 NULL SELECT c2 FROM t1 ORDER BY c2 DESC; c2 9999-12-31 23:59:59 9000-01-01 00:00:00 8000-01-01 00:00:00 6000-01-01 00:00:00 4000-01-01 00:00:00 2010-10-00 00:00:00 2009-01-29 00:00:00 2007-05-25 00:00:00 2007-05-23 09:15:28 2000-01-01 00:00:00 1999-01-01 00:00:00 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-28 00:00:00 1983-09-10 00:00:00 1983-09-05 13:28:00 0000-00-00 00:00:00 NULL SELECT * FROM t1 ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c2 = '9999-12-31 23:59:59' ORDER BY c2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 = '9999-12-31 23:59:59' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 = '9999-12-31 23:59:59' ORDER BY c2 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 = '9999-12-31 23:59:59' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 <> '9999-12-31 23:59:59' ORDER BY c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c2 <> '9999-12-31 23:59:59' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 > '9999-12-31 23:59:59' ORDER BY c2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 > '9999-12-31 23:59:59' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 >= '9999-12-31 23:59:59' ORDER BY c2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 >= '9999-12-31 23:59:59' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 < '9999-12-31 23:59:59' ORDER BY c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c2 < '9999-12-31 23:59:59' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 <= '9999-12-31 23:59:59' ORDER BY c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 <= '9999-12-31 23:59:59' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 <=> '9999-12-31 23:59:59' ORDER BY c2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 <=> '9999-12-31 23:59:59' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 BETWEEN '1000-00-01 00:00:00' AND '9999-12-31 23:59:59' ORDER BY c2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 BETWEEN '1000-00-01 00:00:00' AND '9999-12-31 23:59:59' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 IN ('1000-00-01 00:00:00','9999-12-31 23:59:59') ORDER BY c2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 IN ('1000-00-01 00:00:00','9999-12-31 23:59:59') ORDER BY c2 LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 >= '1000-00-01 00:00:00' AND c2 < '9999-12-31 23:59:59' AND c1 = '9999-12-31 23:59:59' ORDER BY c2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 >= '1000-00-01 00:00:00' AND c2 < '9999-12-31 23:59:59' AND c1 = '9999-12-31 23:59:59' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 <> '9999-12-31 23:59:59' ORDER BY c2 DESC; c1 c2 c3 c4 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 <> '9999-12-31 23:59:59' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 SELECT * FROM t1 WHERE c2 > '9999-12-31 23:59:59' ORDER BY c2 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 > '9999-12-31 23:59:59' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 >= '9999-12-31 23:59:59' ORDER BY c2 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 >= '9999-12-31 23:59:59' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 < '9999-12-31 23:59:59' ORDER BY c2 DESC; c1 c2 c3 c4 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 < '9999-12-31 23:59:59' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 SELECT * FROM t1 WHERE c2 <= '9999-12-31 23:59:59' ORDER BY c2 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 <= '9999-12-31 23:59:59' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c2 <=> '9999-12-31 23:59:59' ORDER BY c2 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 <=> '9999-12-31 23:59:59' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 BETWEEN '1000-00-01 00:00:00' AND '9999-12-31 23:59:59' ORDER BY c2 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 BETWEEN '1000-00-01 00:00:00' AND '9999-12-31 23:59:59' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c2 IN ('1000-00-01 00:00:00','9999-12-31 23:59:59') ORDER BY c2 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 IN ('1000-00-01 00:00:00','9999-12-31 23:59:59') ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 >= '1000-00-01 00:00:00' AND c2 < '9999-12-31 23:59:59' AND c1 = '9999-12-31 23:59:59' ORDER BY c2 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 >= '1000-00-01 00:00:00' AND c2 < '9999-12-31 23:59:59' AND c1 = '9999-12-31 23:59:59' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2 DESC; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t1; total_rows min_value max(c2) 19 0000-00-00 00:00:00 9999-12-31 23:59:59 SELECT * FROM t1 WHERE c4 = '2008-01-05'; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT c2 FROM t1; c2 0000-00-00 00:00:00 1983-09-05 13:28:00 1983-09-10 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 2000-01-01 00:00:00 2007-05-23 09:15:28 2007-05-25 00:00:00 2009-01-29 00:00:00 2010-10-00 00:00:00 4000-01-01 00:00:00 6000-01-01 00:00:00 8000-01-01 00:00:00 9000-01-01 00:00:00 9999-12-31 23:59:59 NULL SELECT c2 FROM t1 ORDER BY c2 DESC; c2 9999-12-31 23:59:59 9000-01-01 00:00:00 8000-01-01 00:00:00 6000-01-01 00:00:00 4000-01-01 00:00:00 2010-10-00 00:00:00 2009-01-29 00:00:00 2007-05-25 00:00:00 2007-05-23 09:15:28 2000-01-01 00:00:00 1999-01-01 00:00:00 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-28 00:00:00 1983-09-10 00:00:00 1983-09-05 13:28:00 0000-00-00 00:00:00 NULL SELECT * FROM t1 ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c2 = '2010-10-00 00:00:00' ORDER BY c2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 = '2010-10-00 00:00:00' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 = '2010-10-00 00:00:00' ORDER BY c2 DESC; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 = '2010-10-00 00:00:00' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 <> '2010-10-00 00:00:00' ORDER BY c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 <> '2010-10-00 00:00:00' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 > '2010-10-00 00:00:00' ORDER BY c2; c1 c2 c3 c4 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 > '2010-10-00 00:00:00' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c2 >= '2010-10-00 00:00:00' ORDER BY c2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 >= '2010-10-00 00:00:00' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 SELECT * FROM t1 WHERE c2 < '2010-10-00 00:00:00' ORDER BY c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c2 < '2010-10-00 00:00:00' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 <= '2010-10-00 00:00:00' ORDER BY c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 <= '2010-10-00 00:00:00' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 <=> '2010-10-00 00:00:00' ORDER BY c2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 <=> '2010-10-00 00:00:00' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 BETWEEN '1000-00-01 00:00:00' AND '2010-10-00 00:00:00' ORDER BY c2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 BETWEEN '1000-00-01 00:00:00' AND '2010-10-00 00:00:00' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 IN ('1000-00-01 00:00:00','2010-10-00 00:00:00') ORDER BY c2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 IN ('1000-00-01 00:00:00','2010-10-00 00:00:00') ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 >= '1000-00-01 00:00:00' AND c2 < '2010-10-00 00:00:00' AND c1 = '2010-00-01 00:00:00' ORDER BY c2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 >= '1000-00-01 00:00:00' AND c2 < '2010-10-00 00:00:00' AND c1 = '2010-00-01 00:00:00' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 <> '2010-10-00 00:00:00' ORDER BY c2 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 <> '2010-10-00 00:00:00' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c2 > '2010-10-00 00:00:00' ORDER BY c2 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 SELECT * FROM t1 WHERE c2 > '2010-10-00 00:00:00' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c2 >= '2010-10-00 00:00:00' ORDER BY c2 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 >= '2010-10-00 00:00:00' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c2 < '2010-10-00 00:00:00' ORDER BY c2 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 < '2010-10-00 00:00:00' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 <= '2010-10-00 00:00:00' ORDER BY c2 DESC; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 <= '2010-10-00 00:00:00' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c2 <=> '2010-10-00 00:00:00' ORDER BY c2 DESC; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 <=> '2010-10-00 00:00:00' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 BETWEEN '1000-00-01 00:00:00' AND '2010-10-00 00:00:00' ORDER BY c2 DESC; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 BETWEEN '1000-00-01 00:00:00' AND '2010-10-00 00:00:00' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c2 IN ('1000-00-01 00:00:00','2010-10-00 00:00:00') ORDER BY c2 DESC; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 IN ('1000-00-01 00:00:00','2010-10-00 00:00:00') ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 >= '1000-00-01 00:00:00' AND c2 < '2010-10-00 00:00:00' AND c1 = '2010-00-01 00:00:00' ORDER BY c2 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 >= '1000-00-01 00:00:00' AND c2 < '2010-10-00 00:00:00' AND c1 = '2010-00-01 00:00:00' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2 DESC; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t1 WHERE c1='1000-00-01 00:00:00' OR c2='9999-12-31 23:59:59'; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT c2 FROM t1 GROUP BY c2; c2 0000-00-00 00:00:00 1983-09-05 13:28:00 1983-09-10 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 2000-01-01 00:00:00 2007-05-23 09:15:28 2007-05-25 00:00:00 2009-01-29 00:00:00 2010-10-00 00:00:00 4000-01-01 00:00:00 6000-01-01 00:00:00 8000-01-01 00:00:00 9000-01-01 00:00:00 9999-12-31 23:59:59 NULL SELECT * FROM t2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t2; total_rows min_value max(c1) 21 0000-00-00 00:00:00 9999-12-31 23:59:59 SELECT * FROM t2 WHERE c3 = '2007-05-24'; c1 c2 c3 c4 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT c1,c2 FROM t2; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 SELECT c1,c2 FROM t2 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 SELECT * FROM t2 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '1000-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 = '1000-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 = '1000-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 = '1000-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 <> '1000-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 <> '1000-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 > '1000-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 > '1000-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c1 >= '1000-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 >= '1000-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c1 < '1000-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 < '1000-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '1000-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '1000-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '1000-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 <=> '1000-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 BETWEEN '1000-00-01 00:00:00' AND '9999-12-31 23:59:59' ORDER BY c1,c2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '1000-00-01 00:00:00' AND '9999-12-31 23:59:59' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c1 IN ('1000-00-01 00:00:00','9999-12-31 23:59:59') ORDER BY c1,c2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 IN ('1000-00-01 00:00:00','9999-12-31 23:59:59') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 >= '1000-00-01 00:00:00' AND c1 < '9999-12-31 23:59:59' AND c2 = '1000-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 >= '1000-00-01 00:00:00' AND c1 < '9999-12-31 23:59:59' AND c2 = '1000-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <> '1000-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 <> '1000-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 > '1000-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 > '1000-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c1 >= '1000-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 >= '1000-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c1 < '1000-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 < '1000-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '1000-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '1000-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '1000-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 <=> '1000-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 BETWEEN '1000-00-01 00:00:00' AND '9999-12-31 23:59:59' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '1000-00-01 00:00:00' AND '9999-12-31 23:59:59' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c1 IN ('1000-00-01 00:00:00','9999-12-31 23:59:59') ORDER BY c1,c2 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 IN ('1000-00-01 00:00:00','9999-12-31 23:59:59') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 >= '1000-00-01 00:00:00' AND c1 < '9999-12-31 23:59:59' AND c2 = '1000-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 >= '1000-00-01 00:00:00' AND c1 < '9999-12-31 23:59:59' AND c2 = '1000-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t2; total_rows min_value max(c1) 21 0000-00-00 00:00:00 9999-12-31 23:59:59 SELECT * FROM t2 WHERE c3 = '2007-05-26'; c1 c2 c3 c4 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT c1,c2 FROM t2; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 SELECT c1,c2 FROM t2 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 SELECT * FROM t2 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <> '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 <> '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c1 > '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 > '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 < '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 < '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 <= '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '9999-12-31 23:59:59' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '9999-12-31 23:59:59' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','9999-12-31 23:59:59') ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','9999-12-31 23:59:59') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '9999-12-31 23:59:59' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '9999-12-31 23:59:59' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <> '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 <> '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c1 > '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 > '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 < '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 < '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 <= '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '9999-12-31 23:59:59' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '9999-12-31 23:59:59' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','9999-12-31 23:59:59') ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','9999-12-31 23:59:59') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '9999-12-31 23:59:59' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '9999-12-31 23:59:59' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t2; total_rows min_value max(c1) 21 0000-00-00 00:00:00 9999-12-31 23:59:59 SELECT * FROM t2 WHERE c3 = '1998-12-28'; c1 c2 c3 c4 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT c1,c2 FROM t2; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 SELECT c1,c2 FROM t2 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 SELECT * FROM t2 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 = '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 = '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 = '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 <> '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 <> '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 > '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 > '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 >= '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 >= '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 SELECT * FROM t2 WHERE c1 < '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 < '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 <= '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 <=> '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01 00:00:' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01 00:00:' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','2010-00-01 00:00:') ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','2010-00-01 00:00:') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01 00:00:' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01 00:00:' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <> '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 <> '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 > '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 > '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 >= '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 >= '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 SELECT * FROM t2 WHERE c1 < '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 < '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 <= '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 <=> '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01 00:00:' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01 00:00:' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','2010-00-01 00:00:') ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','2010-00-01 00:00:') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01 00:00:' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01 00:00:' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t2; total_rows min_value max(c2) 21 0000-00-00 00:00:00 9999-12-31 23:59:59 SELECT * FROM t2 WHERE c4 = '2009-01-29'; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT c1,c2 FROM t2; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 SELECT c1,c2 FROM t2 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 SELECT * FROM t2 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 = '9999-12-31 23:59:59' ORDER BY c1,c2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 = '9999-12-31 23:59:59' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 = '9999-12-31 23:59:59' ORDER BY c1,c2 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 = '9999-12-31 23:59:59' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 <> '9999-12-31 23:59:59' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t2 WHERE c2 <> '9999-12-31 23:59:59' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 > '9999-12-31 23:59:59' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 > '9999-12-31 23:59:59' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 >= '9999-12-31 23:59:59' ORDER BY c1,c2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 >= '9999-12-31 23:59:59' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 < '9999-12-31 23:59:59' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t2 WHERE c2 < '9999-12-31 23:59:59' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <= '9999-12-31 23:59:59' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 <= '9999-12-31 23:59:59' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <=> '9999-12-31 23:59:59' ORDER BY c1,c2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 <=> '9999-12-31 23:59:59' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 BETWEEN '1000-00-01 00:00:00' AND '9999-12-31 23:59:59' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 BETWEEN '1000-00-01 00:00:00' AND '9999-12-31 23:59:59' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t2 WHERE c2 IN ('1000-00-01 00:00:00','9999-12-31 23:59:59') ORDER BY c1,c2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 IN ('1000-00-01 00:00:00','9999-12-31 23:59:59') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 >= '1000-00-01 00:00:00' AND c2 < '9999-12-31 23:59:59' AND c1 = '9999-12-31 23:59:59' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 >= '1000-00-01 00:00:00' AND c2 < '9999-12-31 23:59:59' AND c1 = '9999-12-31 23:59:59' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <> '9999-12-31 23:59:59' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t2 WHERE c2 <> '9999-12-31 23:59:59' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 > '9999-12-31 23:59:59' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 > '9999-12-31 23:59:59' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 >= '9999-12-31 23:59:59' ORDER BY c1,c2 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 >= '9999-12-31 23:59:59' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 < '9999-12-31 23:59:59' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t2 WHERE c2 < '9999-12-31 23:59:59' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <= '9999-12-31 23:59:59' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 <= '9999-12-31 23:59:59' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <=> '9999-12-31 23:59:59' ORDER BY c1,c2 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 <=> '9999-12-31 23:59:59' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 BETWEEN '1000-00-01 00:00:00' AND '9999-12-31 23:59:59' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 BETWEEN '1000-00-01 00:00:00' AND '9999-12-31 23:59:59' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t2 WHERE c2 IN ('1000-00-01 00:00:00','9999-12-31 23:59:59') ORDER BY c1,c2 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 IN ('1000-00-01 00:00:00','9999-12-31 23:59:59') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 >= '1000-00-01 00:00:00' AND c2 < '9999-12-31 23:59:59' AND c1 = '9999-12-31 23:59:59' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 >= '1000-00-01 00:00:00' AND c2 < '9999-12-31 23:59:59' AND c1 = '9999-12-31 23:59:59' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t2; total_rows min_value max(c2) 21 0000-00-00 00:00:00 9999-12-31 23:59:59 SELECT * FROM t2 WHERE c4 = '2008-01-07'; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT c1,c2 FROM t2; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 SELECT c1,c2 FROM t2 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 SELECT * FROM t2 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 = '2010-10-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 = '2010-10-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 = '2010-10-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 = '2010-10-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 <> '2010-10-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 <> '2010-10-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 > '2010-10-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 > '2010-10-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 >= '2010-10-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 >= '2010-10-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 SELECT * FROM t2 WHERE c2 < '2010-10-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 < '2010-10-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <= '2010-10-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 <= '2010-10-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <=> '2010-10-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 <=> '2010-10-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 BETWEEN '1000-00-01 00:00:00' AND '2010-10-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 BETWEEN '1000-00-01 00:00:00' AND '2010-10-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t2 WHERE c2 IN ('1000-00-01 00:00:00','2010-10-00 00:00:00') ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 IN ('1000-00-01 00:00:00','2010-10-00 00:00:00') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 >= '1000-00-01 00:00:00' AND c2 < '2010-10-00 00:00:00' AND c1 = '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 >= '1000-00-01 00:00:00' AND c2 < '2010-10-00 00:00:00' AND c1 = '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <> '2010-10-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 <> '2010-10-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 > '2010-10-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 > '2010-10-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 >= '2010-10-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 >= '2010-10-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 SELECT * FROM t2 WHERE c2 < '2010-10-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 < '2010-10-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <= '2010-10-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 <= '2010-10-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <=> '2010-10-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 <=> '2010-10-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 BETWEEN '1000-00-01 00:00:00' AND '2010-10-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 BETWEEN '1000-00-01 00:00:00' AND '2010-10-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t2 WHERE c2 IN ('1000-00-01 00:00:00','2010-10-00 00:00:00') ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 IN ('1000-00-01 00:00:00','2010-10-00 00:00:00') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c2 >= '1000-00-01 00:00:00' AND c2 < '2010-10-00 00:00:00' AND c1 = '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 >= '1000-00-01 00:00:00' AND c2 < '2010-10-00 00:00:00' AND c1 = '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t3; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t3; total_rows min_value max(c1) 22 0000-00-00 00:00:00 9999-12-31 23:59:59 SELECT * FROM t3 WHERE c3 = '2007-05-24'; c1 c2 c3 c4 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT c1,c2 FROM t3; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 SELECT c1,c2 FROM t3 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1999-01-01 00:00:00 NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 SELECT * FROM t3 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 = '1000-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 = '1000-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 = '1000-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 = '1000-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 <> '1000-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 <> '1000-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 > '1000-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 > '1000-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 >= '1000-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 >= '1000-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 < '1000-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 < '1000-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <= '1000-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <= '1000-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <=> '1000-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 <=> '1000-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 BETWEEN '1000-00-01 00:00:00' AND '9999-12-31 23:59:59' ORDER BY c1,c2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '1000-00-01 00:00:00' AND '9999-12-31 23:59:59' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 IN ('1000-00-01 00:00:00','9999-12-31 23:59:59') ORDER BY c1,c2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 IN ('1000-00-01 00:00:00','9999-12-31 23:59:59') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 >= '1000-00-01 00:00:00' AND c1 < '9999-12-31 23:59:59' AND c2 = '1000-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 >= '1000-00-01 00:00:00' AND c1 < '9999-12-31 23:59:59' AND c2 = '1000-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 <> '1000-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 <> '1000-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 > '1000-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 > '1000-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 >= '1000-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 >= '1000-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 < '1000-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 < '1000-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <= '1000-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <= '1000-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <=> '1000-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 <=> '1000-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 BETWEEN '1000-00-01 00:00:00' AND '9999-12-31 23:59:59' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '1000-00-01 00:00:00' AND '9999-12-31 23:59:59' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 IN ('1000-00-01 00:00:00','9999-12-31 23:59:59') ORDER BY c1,c2 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 IN ('1000-00-01 00:00:00','9999-12-31 23:59:59') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 >= '1000-00-01 00:00:00' AND c1 < '9999-12-31 23:59:59' AND c2 = '1000-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 >= '1000-00-01 00:00:00' AND c1 < '9999-12-31 23:59:59' AND c2 = '1000-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t3; total_rows min_value max(c1) 22 0000-00-00 00:00:00 9999-12-31 23:59:59 SELECT * FROM t3 WHERE c3 = '2007-05-26'; c1 c2 c3 c4 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT c1,c2 FROM t3; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 SELECT c1,c2 FROM t3 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1999-01-01 00:00:00 NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 SELECT * FROM t3 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 = '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 = '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 = '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 = '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <> '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 <> '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 > '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 > '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 < '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 < '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 <= '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <= '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '9999-12-31 23:59:59' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '9999-12-31 23:59:59' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','9999-12-31 23:59:59') ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','9999-12-31 23:59:59') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '9999-12-31 23:59:59' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '9999-12-31 23:59:59' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 <> '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 <> '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 > '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 > '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 < '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 < '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 <= '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <= '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '9999-12-31 23:59:59' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '9999-12-31 23:59:59' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','9999-12-31 23:59:59') ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','9999-12-31 23:59:59') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '9999-12-31 23:59:59' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '9999-12-31 23:59:59' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t3; total_rows min_value max(c1) 22 0000-00-00 00:00:00 9999-12-31 23:59:59 SELECT * FROM t3 WHERE c3 = '1998-12-28'; c1 c2 c3 c4 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT c1,c2 FROM t3; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 SELECT c1,c2 FROM t3 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1999-01-01 00:00:00 NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 SELECT * FROM t3 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 = '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 = '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 = '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 = '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 <> '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 <> '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 > '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 > '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 >= '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 >= '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 SELECT * FROM t3 WHERE c1 < '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 < '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 <= '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 <= '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 <=> '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 <=> '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01 00:00:' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01 00:00:' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','2010-00-01 00:00:') ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','2010-00-01 00:00:') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01 00:00:' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01 00:00:' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 <> '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 <> '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 > '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 > '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 >= '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 >= '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 SELECT * FROM t3 WHERE c1 < '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 < '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 <= '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 <= '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 <=> '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 <=> '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01 00:00:' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01 00:00:' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','2010-00-01 00:00:') ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','2010-00-01 00:00:') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01 00:00:' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01 00:00:' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t3; total_rows min_value max(c2) 22 0000-00-00 00:00:00 9999-12-31 23:59:59 SELECT * FROM t3 WHERE c4 = '2009-01-29'; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT c1,c2 FROM t3; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 SELECT c1,c2 FROM t3 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1999-01-01 00:00:00 NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 SELECT * FROM t3 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 = '9999-12-31 23:59:59' ORDER BY c1,c2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 = '9999-12-31 23:59:59' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 = '9999-12-31 23:59:59' ORDER BY c1,c2 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 = '9999-12-31 23:59:59' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 <> '9999-12-31 23:59:59' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t3 WHERE c2 <> '9999-12-31 23:59:59' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 > '9999-12-31 23:59:59' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 > '9999-12-31 23:59:59' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 >= '9999-12-31 23:59:59' ORDER BY c1,c2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 >= '9999-12-31 23:59:59' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 < '9999-12-31 23:59:59' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t3 WHERE c2 < '9999-12-31 23:59:59' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 <= '9999-12-31 23:59:59' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 <= '9999-12-31 23:59:59' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 <=> '9999-12-31 23:59:59' ORDER BY c1,c2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 <=> '9999-12-31 23:59:59' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 BETWEEN '1000-00-01 00:00:00' AND '9999-12-31 23:59:59' ORDER BY c1,c2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 BETWEEN '1000-00-01 00:00:00' AND '9999-12-31 23:59:59' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 IN ('1000-00-01 00:00:00','9999-12-31 23:59:59') ORDER BY c1,c2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 IN ('1000-00-01 00:00:00','9999-12-31 23:59:59') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 >= '1000-00-01 00:00:00' AND c2 < '9999-12-31 23:59:59' AND c1 = '9999-12-31 23:59:59' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 >= '1000-00-01 00:00:00' AND c2 < '9999-12-31 23:59:59' AND c1 = '9999-12-31 23:59:59' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 <> '9999-12-31 23:59:59' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t3 WHERE c2 <> '9999-12-31 23:59:59' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 > '9999-12-31 23:59:59' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 > '9999-12-31 23:59:59' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 >= '9999-12-31 23:59:59' ORDER BY c1,c2 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 >= '9999-12-31 23:59:59' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 < '9999-12-31 23:59:59' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 SELECT * FROM t3 WHERE c2 < '9999-12-31 23:59:59' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 <= '9999-12-31 23:59:59' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 <= '9999-12-31 23:59:59' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 <=> '9999-12-31 23:59:59' ORDER BY c1,c2 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 <=> '9999-12-31 23:59:59' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 BETWEEN '1000-00-01 00:00:00' AND '9999-12-31 23:59:59' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 BETWEEN '1000-00-01 00:00:00' AND '9999-12-31 23:59:59' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 IN ('1000-00-01 00:00:00','9999-12-31 23:59:59') ORDER BY c1,c2 DESC; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 IN ('1000-00-01 00:00:00','9999-12-31 23:59:59') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 >= '1000-00-01 00:00:00' AND c2 < '9999-12-31 23:59:59' AND c1 = '9999-12-31 23:59:59' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 >= '1000-00-01 00:00:00' AND c2 < '9999-12-31 23:59:59' AND c1 = '9999-12-31 23:59:59' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t3; total_rows min_value max(c2) 22 0000-00-00 00:00:00 9999-12-31 23:59:59 SELECT * FROM t3 WHERE c4 = '2008-01-09'; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT c1,c2 FROM t3; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 SELECT c1,c2 FROM t3 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1999-01-01 00:00:00 NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 SELECT * FROM t3 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 = '2010-10-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 = '2010-10-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 = '2010-10-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 = '2010-10-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 <> '2010-10-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 <> '2010-10-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 > '2010-10-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 > '2010-10-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 >= '2010-10-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 >= '2010-10-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 SELECT * FROM t3 WHERE c2 < '2010-10-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 < '2010-10-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 <= '2010-10-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 <= '2010-10-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 <=> '2010-10-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 <=> '2010-10-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 BETWEEN '1000-00-01 00:00:00' AND '2010-10-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 BETWEEN '1000-00-01 00:00:00' AND '2010-10-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 IN ('1000-00-01 00:00:00','2010-10-00 00:00:00') ORDER BY c1,c2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 IN ('1000-00-01 00:00:00','2010-10-00 00:00:00') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 >= '1000-00-01 00:00:00' AND c2 < '2010-10-00 00:00:00' AND c1 = '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 >= '1000-00-01 00:00:00' AND c2 < '2010-10-00 00:00:00' AND c1 = '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 <> '2010-10-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 <> '2010-10-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 > '2010-10-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 > '2010-10-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 >= '2010-10-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 >= '2010-10-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 SELECT * FROM t3 WHERE c2 < '2010-10-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 < '2010-10-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 <= '2010-10-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 <= '2010-10-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 <=> '2010-10-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 <=> '2010-10-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 BETWEEN '1000-00-01 00:00:00' AND '2010-10-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 BETWEEN '1000-00-01 00:00:00' AND '2010-10-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 IN ('1000-00-01 00:00:00','2010-10-00 00:00:00') ORDER BY c1,c2 DESC; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 IN ('1000-00-01 00:00:00','2010-10-00 00:00:00') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c2 >= '1000-00-01 00:00:00' AND c2 < '2010-10-00 00:00:00' AND c1 = '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 >= '1000-00-01 00:00:00' AND c2 < '2010-10-00 00:00:00' AND c1 = '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 2009-01-29 11:11:27 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 NULL 2009-01-29 11:11:27 3000-01-01 00:00:00 4000-01-01 00:00:00 2009-01-03 2009-01-04 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 2009-01-05 2009-01-06 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 2009-01-07 2009-01-08 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 2009-01-09 2009-01-10 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 2009-01-11 2009-01-12 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 2009-01-01 2009-01-02 00:00:00 SELECT c1 FROM t3 GROUP BY c1; c1 0000-00-00 00:00:00 1000-01-01 00:00:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 2007-05-23 09:15:28 2007-05-25 00:00:00 2008-01-01 00:00:00 2008-01-06 00:00:00 2009-01-29 11:11:27 2010-00-01 00:00:00 3000-01-01 00:00:00 5000-01-01 00:00:00 7000-01-01 00:00:00 9000-01-01 00:00:00 9999-12-31 23:59:59 SELECT DISTINCT c1 FROM t3; c1 0000-00-00 00:00:00 1000-01-01 00:00:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 2007-05-23 09:15:28 2007-05-25 00:00:00 2008-01-01 00:00:00 2008-01-06 00:00:00 2009-01-29 11:11:27 2010-00-01 00:00:00 3000-01-01 00:00:00 5000-01-01 00:00:00 7000-01-01 00:00:00 9000-01-01 00:00:00 9999-12-31 23:59:59 SELECT c1,MIN(c2) FROM t3 GROUP BY c1; c1 MIN(c2) 0000-00-00 00:00:00 0000-00-00 00:00:00 1000-01-01 00:00:00 2000-01-01 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1999-01-01 00:00:00 NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2010-00-01 00:00:00 2010-10-00 00:00:00 3000-01-01 00:00:00 4000-01-01 00:00:00 5000-01-01 00:00:00 6000-01-01 00:00:00 7000-01-01 00:00:00 8000-01-01 00:00:00 9000-01-01 00:00:00 9000-01-01 00:00:00 9999-12-31 23:59:59 9999-12-31 23:59:59 DROP TABLE t1,t2,t3,t4; CREATE TABLE t1(c1 TIMESTAMP NOT NULL, c2 TIMESTAMP NULL, c3 DATE, c4 DATETIME, PRIMARY KEY(c1), UNIQUE INDEX(c2)); CREATE TABLE t2(c1 TIMESTAMP NOT NULL, c2 TIMESTAMP NULL, c3 DATE, c4 DATETIME, PRIMARY KEY(c1,c2)); CREATE TABLE t3(c1 TIMESTAMP NOT NULL, c2 TIMESTAMP NULL, c3 DATE, c4 DATETIME, UNIQUE INDEX idx(c1,c2)); CREATE TABLE t4(c1 TIMESTAMP NOT NULL, c2 TIMESTAMP NULL, c3 DATE, c4 DATETIME); INSERT INTO t1 VALUES('98-12-31 11:30:45','98.12.31 11+30+45','98-12-31 11:30:45','98.12.31 11+30+45'),('98/12/30 11*30*45','98@12@30 11^30^45','98/12/30 11*30*45','98@12@30 11^30^45'),('98-12-29','98.12.29','98-12-29','98.12.29'),('98/12/28','98@12@28','98/12/28','98@12@28'); Warnings: Note 1265 Data truncated for column 'c3' at row 1 Note 1265 Data truncated for column 'c3' at row 2 INSERT INTO t2 VALUES('98-12-31 11:30:45','98.12.31 11+30+45','98-12-31 11:30:45','98.12.31 11+30+45'),('98/12/30 11*30*45','98@12@30 11^30^45','98/12/30 11*30*45','98@12@30 11^30^45'),('98-12-29','98.12.29','98-12-29','98.12.29'),('98/12/28','98@12@28','98/12/28','98@12@28'); Warnings: Note 1265 Data truncated for column 'c3' at row 1 Note 1265 Data truncated for column 'c3' at row 2 INSERT INTO t3 VALUES('98-12-31 11:30:45','98.12.31 11+30+45','98-12-31 11:30:45','98.12.31 11+30+45'),('98/12/30 11*30*45','98@12@30 11^30^45','98/12/30 11*30*45','98@12@30 11^30^45'),('98-12-29','98.12.29','98-12-29','98.12.29'),('98/12/28','98@12@28','98/12/28','98@12@28'); Warnings: Note 1265 Data truncated for column 'c3' at row 1 Note 1265 Data truncated for column 'c3' at row 2 INSERT INTO t4 VALUES('98-12-31 11:30:45','98.12.31 11+30+45','98-12-31 11:30:45','98.12.31 11+30+45'),('98/12/30 11*30*45','98@12@30 11^30^45','98/12/30 11*30*45','98@12@30 11^30^45'),('98-12-29','98.12.29','98-12-29','98.12.29'),('98/12/28','98@12@28','98/12/28','98@12@28'); Warnings: Note 1265 Data truncated for column 'c3' at row 1 Note 1265 Data truncated for column 'c3' at row 2 INSERT INTO t1 VALUES('20070523091528','070523091528','20070524091528','070524091528'),('20070525','070525','20070526','070526'); Warnings: Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t2 VALUES('20070523091528','070523091528','20070524091528','070524091528'),('20070525','070525','20070526','070526'); Warnings: Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t3 VALUES('20070523091528','070523091528','20070524091528','070524091528'),('20070525','070525','20070526','070526'); Warnings: Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t4 VALUES('20070523091528','070523091528','20070524091528','070524091528'),('20070525','070525','20070526','070526'); Warnings: Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 VALUES(19830905132800,830905132800,19830906132800,830906132800),(19830907,830907,19830908,830908); Warnings: Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t2 VALUES(19830905132800,830905132800,19830906132800,830906132800),(19830907,830907,19830908,830908); Warnings: Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t3 VALUES(19830905132800,830905132800,19830906132800,830906132800),(19830907,830907,19830908,830908); Warnings: Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t4 VALUES(19830905132800,830905132800,19830906132800,830906132800),(19830907,830907,19830908,830908); Warnings: Note 1265 Data truncated for column 'c3' at row 1 SET TIMESTAMP=1233216687; INSERT INTO t1 VALUES(NOW(),CURRENT_DATE,NOW(),CURRENT_DATE); Warnings: Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t2 VALUES(NOW(),CURRENT_DATE,NOW(),CURRENT_DATE); Warnings: Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t3 VALUES(NOW(),CURRENT_DATE,NOW(),CURRENT_DATE); Warnings: Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t4 VALUES(NOW(),CURRENT_DATE,NOW(),CURRENT_DATE); Warnings: Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t2 VALUES('98-12-31 11:30:45','98@12@30 11^30^45','98-12-31 11:30:45','98.12.31 11+30+45'),('98-12-29','98@12@30 11^30^45','98/12/30 11*30*45','98@12@30 11^30^45'); Warnings: Note 1265 Data truncated for column 'c3' at row 1 Note 1265 Data truncated for column 'c3' at row 2 INSERT INTO t3 VALUES('98-12-31 11:30:45','98@12@30 11^30^45','98-12-31 11:30:45','98.12.31 11+30+45'),('98-12-29','98@12@30 11^30^45','98/12/30 11*30*45','98@12@30 11^30^45'); Warnings: Note 1265 Data truncated for column 'c3' at row 1 Note 1265 Data truncated for column 'c3' at row 2 INSERT INTO t1 VALUES('2008-01-01',NULL,'08-01-02','08/01/03'); INSERT INTO t3 VALUES('2008-01-01',NULL,'08-01-02','08/01/03'); INSERT INTO t4 VALUES('2008-01-01',NULL,'08-01-02','08/01/03'); INSERT INTO t1(c1,c2) VALUES('08/01/17',NULL); DELETE FROM t1 WHERE c1='08/01/17' AND c2 IS NULL; INSERT INTO t1 VALUES('','','08-01-04','08/01/05') /* Inserts zero dates for '' strings */; Warnings: Warning 1265 Data truncated for column 'c1' at row 1 Warning 1265 Data truncated for column 'c2' at row 1 INSERT INTO t2 VALUES('2008-04-31','2008-04-31','08-01-06','08/01/07') /* Inserts zero dates for invalid dates */; Warnings: Warning 1265 Data truncated for column 'c1' at row 1 Warning 1265 Data truncated for column 'c2' at row 1 INSERT INTO t3 VALUES('10:45:15','10:45:15','08-01-08','08/1/9') /* Inserts zero dates for invalid dates */; Warnings: Warning 1265 Data truncated for column 'c1' at row 1 Warning 1265 Data truncated for column 'c2' at row 1 INSERT INTO t2 VALUES('0000-00-00','08-01-06','08-01-06','08/01/07'); INSERT INTO t3 VALUES('08-01-06','00-00-00','08-01-08','08/1/9'); INSERT INTO t4 VALUES('abcd','abcd','08-01-10','08/01/11'),(1234,1234,'08-01-12','08/01/13') /* Inserts zero dates for absurd dates */; Warnings: Warning 1265 Data truncated for column 'c1' at row 1 Warning 1265 Data truncated for column 'c2' at row 1 Warning 1265 Data truncated for column 'c1' at row 2 Warning 1265 Data truncated for column 'c2' at row 2 SELECT * FROM t1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t4; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-10 2008-01-11 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-12 2008-01-13 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t1; total_rows min_value max(c1) 11 0000-00-00 00:00:00 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c3 = '2007-05-24'; c1 c2 c3 c4 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT c1 FROM t1; c1 0000-00-00 00:00:00 1983-09-05 13:28:00 1983-09-07 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-25 00:00:00 2008-01-01 00:00:00 2009-01-29 11:11:27 SELECT c1 FROM t1 ORDER BY c1 DESC; c1 2009-01-29 11:11:27 2008-01-01 00:00:00 2007-05-25 00:00:00 2007-05-23 09:15:28 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-05 13:28:00 0000-00-00 00:00:00 SELECT * FROM t1 ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c1 = '1998-12-31 11:30:45' ORDER BY c1; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c1 = '1998-12-31 11:30:45' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c1 = '1998-12-31 11:30:45' ORDER BY c1 DESC; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c1 = '1998-12-31 11:30:45' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c1 <> '1998-12-31 11:30:45' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 <> '1998-12-31 11:30:45' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 > '1998-12-31 11:30:45' ORDER BY c1; c1 c2 c3 c4 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 > '1998-12-31 11:30:45' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT * FROM t1 WHERE c1 >= '1998-12-31 11:30:45' ORDER BY c1; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 >= '1998-12-31 11:30:45' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t1 WHERE c1 < '1998-12-31 11:30:45' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t1 WHERE c1 < '1998-12-31 11:30:45' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 <= '1998-12-31 11:30:45' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c1 <= '1998-12-31 11:30:45' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 <=> '1998-12-31 11:30:45' ORDER BY c1; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c1 <=> '1998-12-31 11:30:45' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00 00:00:00' AND '1998-12-29 00:00:00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00 00:00:00' AND '1998-12-29 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00 00:00:00','1998-12-29 00:00:00') ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00 00:00:00','1998-12-29 00:00:00') ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00 00:00:00' AND c1 < '1998-12-29 00:00:00' AND c2 = '1983-09-07 00:00:00' ORDER BY c1; c1 c2 c3 c4 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00 00:00:00' AND c1 < '1998-12-29 00:00:00' AND c2 = '1983-09-07 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 <> '1998-12-31 11:30:45' ORDER BY c1 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <> '1998-12-31 11:30:45' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c1 > '1998-12-31 11:30:45' ORDER BY c1 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t1 WHERE c1 > '1998-12-31 11:30:45' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c1 >= '1998-12-31 11:30:45' ORDER BY c1 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c1 >= '1998-12-31 11:30:45' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c1 < '1998-12-31 11:30:45' ORDER BY c1 DESC; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 < '1998-12-31 11:30:45' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t1 WHERE c1 <= '1998-12-31 11:30:45' ORDER BY c1 DESC; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <= '1998-12-31 11:30:45' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t1 WHERE c1 <=> '1998-12-31 11:30:45' ORDER BY c1 DESC; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c1 <=> '1998-12-31 11:30:45' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00 00:00:00' AND '1998-12-29 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00 00:00:00' AND '1998-12-29 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00 00:00:00','1998-12-29 00:00:00') ORDER BY c1 DESC; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00 00:00:00','1998-12-29 00:00:00') ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00 00:00:00' AND c1 < '1998-12-29 00:00:00' AND c2 = '1983-09-07 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00 00:00:00' AND c1 < '1998-12-29 00:00:00' AND c2 = '1983-09-07 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t1; total_rows min_value max(c1) 11 0000-00-00 00:00:00 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c3 = '2007-05-26'; c1 c2 c3 c4 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT c1 FROM t1; c1 0000-00-00 00:00:00 1983-09-05 13:28:00 1983-09-07 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-25 00:00:00 2008-01-01 00:00:00 2009-01-29 11:11:27 SELECT c1 FROM t1 ORDER BY c1 DESC; c1 2009-01-29 11:11:27 2008-01-01 00:00:00 2007-05-25 00:00:00 2007-05-23 09:15:28 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-05 13:28:00 0000-00-00 00:00:00 SELECT * FROM t1 ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c1 = '0000-00-00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 = '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 = '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 = '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <> '0000-00-00' ORDER BY c1; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 <> '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t1 WHERE c1 > '0000-00-00' ORDER BY c1; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 > '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 < '0000-00-00' ORDER BY c1; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 < '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 <= '0000-00-00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <= '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <=> '0000-00-00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <=> '0000-00-00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '1998-12-31 11:30:45' ORDER BY c1; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '1998-12-31 11:30:45' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 <> '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 <> '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c1 > '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 > '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c1 < '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 < '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 <= '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <= '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <=> '0000-00-00' ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <=> '0000-00-00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1 DESC; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '1998-12-31 11:30:45' ORDER BY c1 DESC; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '1998-12-31 11:30:45' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t1; total_rows min_value max(c2) 11 0000-00-00 00:00:00 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c4 = '2007-05-26 00:00:00'; c1 c2 c3 c4 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT c2 FROM t1; c2 0000-00-00 00:00:00 1983-09-05 13:28:00 1983-09-07 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-25 00:00:00 2009-01-29 00:00:00 NULL SELECT c2 FROM t1 ORDER BY c2 DESC; c2 2009-01-29 00:00:00 2007-05-25 00:00:00 2007-05-23 09:15:28 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-05 13:28:00 0000-00-00 00:00:00 NULL SELECT * FROM t1 ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT * FROM t1 WHERE c2 = '1998-12-30 11:30:45' ORDER BY c2; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t1 WHERE c2 = '1998-12-30 11:30:45' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t1 WHERE c2 = '1998-12-30 11:30:45' ORDER BY c2 DESC; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t1 WHERE c2 = '1998-12-30 11:30:45' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t1 WHERE c2 <> '1998-12-30 11:30:45' ORDER BY c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c2 <> '1998-12-30 11:30:45' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 > '1998-12-30 11:30:45' ORDER BY c2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c2 > '1998-12-30 11:30:45' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t1 WHERE c2 >= '1998-12-30 11:30:45' ORDER BY c2; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c2 >= '1998-12-30 11:30:45' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c2 < '1998-12-30 11:30:45' ORDER BY c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t1 WHERE c2 < '1998-12-30 11:30:45' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 <= '1998-12-30 11:30:45' ORDER BY c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t1 WHERE c2 <= '1998-12-30 11:30:45' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 <=> '1998-12-30 11:30:45' ORDER BY c2; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t1 WHERE c2 <=> '1998-12-30 11:30:45' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t1 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '1998-12-31 11:30:45' ORDER BY c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '1998-12-31 11:30:45' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 IN ('0000-00-00 00:00:00','1998-12-31 11:30:45') ORDER BY c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c2 IN ('0000-00-00 00:00:00','1998-12-31 11:30:45') ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '1998-12-31 11:30:45' AND c1 = '0000-00-00 00:00:00' ORDER BY c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '1998-12-31 11:30:45' AND c1 = '0000-00-00 00:00:00' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 <> '1998-12-30 11:30:45' ORDER BY c2 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 <> '1998-12-30 11:30:45' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT * FROM t1 WHERE c2 > '1998-12-30 11:30:45' ORDER BY c2 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t1 WHERE c2 > '1998-12-30 11:30:45' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT * FROM t1 WHERE c2 >= '1998-12-30 11:30:45' ORDER BY c2 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t1 WHERE c2 >= '1998-12-30 11:30:45' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT * FROM t1 WHERE c2 < '1998-12-30 11:30:45' ORDER BY c2 DESC; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 < '1998-12-30 11:30:45' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t1 WHERE c2 <= '1998-12-30 11:30:45' ORDER BY c2 DESC; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 <= '1998-12-30 11:30:45' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t1 WHERE c2 <=> '1998-12-30 11:30:45' ORDER BY c2 DESC; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t1 WHERE c2 <=> '1998-12-30 11:30:45' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t1 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '1998-12-31 11:30:45' ORDER BY c2 DESC; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '1998-12-31 11:30:45' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t1 WHERE c2 IN ('0000-00-00 00:00:00','1998-12-31 11:30:45') ORDER BY c2 DESC; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 IN ('0000-00-00 00:00:00','1998-12-31 11:30:45') ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '1998-12-31 11:30:45' AND c1 = '0000-00-00 00:00:00' ORDER BY c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '1998-12-31 11:30:45' AND c1 = '0000-00-00 00:00:00' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2 DESC; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT * FROM t2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t2; total_rows min_value max(c1) 13 0000-00-00 00:00:00 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c3 = '2008-01-06'; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT c1,c2 FROM t2; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT c1,c2 FROM t2 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t2 WHERE c1 = '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t2 WHERE c1 = '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t2 WHERE c1 = '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t2 WHERE c1 <> '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 <> '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 > '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 > '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t2 WHERE c1 >= '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 >= '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t2 WHERE c1 < '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t2 WHERE c1 < '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t2 WHERE c1 <= '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t2 WHERE c1 <=> '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t2 WHERE c1 BETWEEN '1983-09-07 00:00:00' AND '2007-05-23 09:15:28' ORDER BY c1,c2; c1 c2 c3 c4 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c1 BETWEEN '1983-09-07 00:00:00' AND '2007-05-23 09:15:28' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t2 WHERE c1 IN ('1983-09-07 00:00:00','2007-05-23 09:15:28') ORDER BY c1,c2; c1 c2 c3 c4 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c1 IN ('1983-09-07 00:00:00','2007-05-23 09:15:28') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c1 >= '1983-09-07 00:00:00' AND c1 < '2007-05-23 09:15:28' AND c2 = '1998-12-30 11:30:45' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t2 WHERE c1 >= '1983-09-07 00:00:00' AND c1 < '2007-05-23 09:15:28' AND c2 = '1998-12-30 11:30:45' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <> '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 <> '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 > '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 > '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t2 WHERE c1 >= '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 >= '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t2 WHERE c1 < '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t2 WHERE c1 < '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t2 WHERE c1 <= '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t2 WHERE c1 <=> '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '1983-09-07 00:00:00' AND '2007-05-23 09:15:28' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c1 BETWEEN '1983-09-07 00:00:00' AND '2007-05-23 09:15:28' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t2 WHERE c1 IN ('1983-09-07 00:00:00','2007-05-23 09:15:28') ORDER BY c1,c2 DESC; c1 c2 c3 c4 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c1 IN ('1983-09-07 00:00:00','2007-05-23 09:15:28') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c1 >= '1983-09-07 00:00:00' AND c1 < '2007-05-23 09:15:28' AND c2 = '1998-12-30 11:30:45' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t2 WHERE c1 >= '1983-09-07 00:00:00' AND c1 < '2007-05-23 09:15:28' AND c2 = '1998-12-30 11:30:45' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t2; total_rows min_value max(c1) 13 0000-00-00 00:00:00 2009-01-29 11:11:27 SELECT * FROM t2 WHERE c3 = '1998-12-29'; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT c1,c2 FROM t2; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT c1,c2 FROM t2 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <> '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 <> '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t2 WHERE c1 > '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 > '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 < '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 < '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 <= '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '2007-05-23 09:15:28' ORDER BY c1,c2; c1 c2 c3 c4 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '2007-05-23 09:15:28' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <> '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 <> '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t2 WHERE c1 > '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 > '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 < '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 < '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 <= '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '2007-05-23 09:15:28' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '2007-05-23 09:15:28' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t2; total_rows min_value max(c2) 13 0000-00-00 00:00:00 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c4 = '2007-05-24 09:15:28'; c1 c2 c3 c4 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT c1,c2 FROM t2; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT c1,c2 FROM t2 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t2 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 = '1983-09-05 13:28:00' ORDER BY c1,c2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 = '1983-09-05 13:28:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 = '1983-09-05 13:28:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 = '1983-09-05 13:28:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 <> '1983-09-05 13:28:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 <> '1983-09-05 13:28:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 > '1983-09-05 13:28:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 > '1983-09-05 13:28:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t2 WHERE c2 >= '1983-09-05 13:28:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 >= '1983-09-05 13:28:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 < '1983-09-05 13:28:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 < '1983-09-05 13:28:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <= '1983-09-05 13:28:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 <= '1983-09-05 13:28:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 <=> '1983-09-05 13:28:00' ORDER BY c1,c2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 <=> '1983-09-05 13:28:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '2007-05-23 09:15:28' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '2007-05-23 09:15:28' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 IN ('0000-00-00 00:00:00','2007-05-23 09:15:28') ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c2 IN ('0000-00-00 00:00:00','2007-05-23 09:15:28') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '2007-05-23 09:15:28' AND c1 = '0000-00-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '2007-05-23 09:15:28' AND c1 = '0000-00-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <> '1983-09-05 13:28:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 <> '1983-09-05 13:28:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 > '1983-09-05 13:28:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 > '1983-09-05 13:28:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t2 WHERE c2 >= '1983-09-05 13:28:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 >= '1983-09-05 13:28:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 < '1983-09-05 13:28:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 < '1983-09-05 13:28:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <= '1983-09-05 13:28:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 <= '1983-09-05 13:28:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 <=> '1983-09-05 13:28:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 <=> '1983-09-05 13:28:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '2007-05-23 09:15:28' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '2007-05-23 09:15:28' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c2 IN ('0000-00-00 00:00:00','2007-05-23 09:15:28') ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c2 IN ('0000-00-00 00:00:00','2007-05-23 09:15:28') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT * FROM t2 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '2007-05-23 09:15:28' AND c1 = '0000-00-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '2007-05-23 09:15:28' AND c1 = '0000-00-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t3; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t3; total_rows min_value max(c1) 14 0000-00-00 00:00:00 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c3 = '2007-05-24'; c1 c2 c3 c4 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT c1,c2 FROM t3; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT c1,c2 FROM t3 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 = '1998-12-28 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t3 WHERE c1 = '1998-12-28 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t3 WHERE c1 = '1998-12-28 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t3 WHERE c1 = '1998-12-28 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t3 WHERE c1 <> '1998-12-28 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 <> '1998-12-28 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 > '1998-12-28 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 > '1998-12-28 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t3 WHERE c1 >= '1998-12-28 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 >= '1998-12-28 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c1 < '1998-12-28 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t3 WHERE c1 < '1998-12-28 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 <= '1998-12-28 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t3 WHERE c1 <= '1998-12-28 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 <=> '1998-12-28 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t3 WHERE c1 <=> '1998-12-28 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '1998-12-31 11:30:45' AND '2008-01-06 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '1998-12-31 11:30:45' AND '2008-01-06 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t3 WHERE c1 IN ('1998-12-31 11:30:45','2008-01-06 00:00:00') ORDER BY c1,c2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IN ('1998-12-31 11:30:45','2008-01-06 00:00:00') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t3 WHERE c1 >= '1998-12-31 11:30:45' AND c1 < '2008-01-06 00:00:00' AND c2 = '1998-12-28 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 >= '1998-12-31 11:30:45' AND c1 < '2008-01-06 00:00:00' AND c2 = '1998-12-28 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 <> '1998-12-28 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 <> '1998-12-28 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 > '1998-12-28 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 > '1998-12-28 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c1 >= '1998-12-28 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 >= '1998-12-28 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t3 WHERE c1 < '1998-12-28 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t3 WHERE c1 < '1998-12-28 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 <= '1998-12-28 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t3 WHERE c1 <= '1998-12-28 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 <=> '1998-12-28 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t3 WHERE c1 <=> '1998-12-28 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '1998-12-31 11:30:45' AND '2008-01-06 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '1998-12-31 11:30:45' AND '2008-01-06 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t3 WHERE c1 IN ('1998-12-31 11:30:45','2008-01-06 00:00:00') ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IN ('1998-12-31 11:30:45','2008-01-06 00:00:00') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t3 WHERE c1 >= '1998-12-31 11:30:45' AND c1 < '2008-01-06 00:00:00' AND c2 = '1998-12-28 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 >= '1998-12-31 11:30:45' AND c1 < '2008-01-06 00:00:00' AND c2 = '1998-12-28 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t3; total_rows min_value max(c1) 14 0000-00-00 00:00:00 2009-01-29 11:11:27 SELECT * FROM t3 WHERE c3 = '1998-12-29'; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT c1,c2 FROM t3; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT c1,c2 FROM t3 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 = '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 = '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 = '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 = '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <> '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 <> '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t3 WHERE c1 > '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 > '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 < '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 < '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 <= '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <= '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '1998-12-30 11:30:45' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '1998-12-30 11:30:45' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 <> '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 <> '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t3 WHERE c1 > '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 > '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 < '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 < '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 <= '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <= '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <=> '0000-00-00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '2009-01-29' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','2009-01-29') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '1998-12-30 11:30:45' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '2009-01-29' AND c2 = '1998-12-30 11:30:45' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t3; total_rows min_value max(c2) 14 0000-00-00 00:00:00 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c4 = '2007-05-24 09:15:28'; c1 c2 c3 c4 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT c1,c2 FROM t3; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT c1,c2 FROM t3 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 SELECT * FROM t3 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 = '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c2 = '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c2 = '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c2 = '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c2 <> '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 <> '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 > '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 > '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t3 WHERE c2 >= '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 >= '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t3 WHERE c2 < '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 < '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 <= '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 <= '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 <=> '1998-12-29 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c2 <=> '1998-12-29 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '1998-12-30 11:30:45' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '1998-12-30 11:30:45' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 IN ('0000-00-00 00:00:00','1998-12-30 11:30:45') ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 IN ('0000-00-00 00:00:00','1998-12-30 11:30:45') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t3 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '1998-12-30 11:30:45' AND c1 = '0000-00-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '1998-12-30 11:30:45' AND c1 = '0000-00-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 <> '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 <> '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 > '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 > '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t3 WHERE c2 >= '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 >= '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c2 < '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 < '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 <= '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 <= '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 <=> '1998-12-29 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c2 <=> '1998-12-29 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 SELECT * FROM t3 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '1998-12-30 11:30:45' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 BETWEEN '0000-00-00 00:00:00' AND '1998-12-30 11:30:45' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 IN ('0000-00-00 00:00:00','1998-12-30 11:30:45') ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 IN ('0000-00-00 00:00:00','1998-12-30 11:30:45') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 SELECT * FROM t3 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '1998-12-30 11:30:45' AND c1 = '0000-00-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 >= '0000-00-00 00:00:00' AND c2 < '1998-12-30 11:30:45' AND c1 = '0000-00-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 INSERT INTO t1(c1,c2) VALUES('20070525','070523091528') /* Row with c1='20070525' exists */; ERROR 23000: Duplicate entry '2007-05-25 00:00:00' for key 'PRIMARY' INSERT INTO t2(c1,c2) VALUES(19830907,830907) /* Row with c1=19830907,c2=830907 exists */; ERROR 23000: Duplicate entry '1983-09-07 00:00:00-1983-09-07 00:00:00' for key 'PRIMARY' INSERT INTO t1(c1,c2) VALUES(19840905,830907) /* Row with c2=830907 exists */; ERROR 23000: Duplicate entry '1983-09-07 00:00:00' for key 'c2' INSERT INTO t3(c1,c2) VALUES(19830907,830907) /* Row with c1=19830907,c2=830907 exists */; ERROR 23000: Duplicate entry '1983-09-07 00:00:00-1983-09-07 00:00:00' for key 'idx' INSERT IGNORE INTO t1(c1,c2) VALUES('20070525','20070527') /* doesn't throw error */; INSERT IGNORE INTO t2(c1,c2) VALUES(19830907,830907) /* doesn't throw error */; INSERT IGNORE INTO t1(c1,c2) VALUES(19840905,830907) /* doesn't throw error */; INSERT IGNORE INTO t3(c1,c2) VALUES(19830907,830907) /* doesn't throw error */; SELECT * FROM t1 WHERE c1='20070525' /* Returns 1 row with c1=2007-05-25 */; c1 c2 c3 c4 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT * FROM t2 WHERE c1=19830907 AND c2=830907 /* Returns 1 row with c1=1983-09-07 and c2=1983-09-07 */; c1 c2 c3 c4 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t1 WHERE c2=830907 /* Returns 1 row with c2=1983-09-07 */; c1 c2 c3 c4 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t3 WHERE c1=19830907 AND c2=830907 /* Returns 1 row with c1=1983-09-07 and c2=1983-09-07 */; c1 c2 c3 c4 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t1 WHERE c1='20070527' /* Returns no rows */; c1 c2 c3 c4 INSERT INTO t1(c1) VALUES('20070525') ON DUPLICATE KEY UPDATE c1='20070527'; SELECT * FROM t1 WHERE c1='20070527' /* Returns 1 row with c1=2007-05-27 */; c1 c2 c3 c4 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT * FROM t2 WHERE c1=19830909 AND c2=830910 /* Returns no rows */; c1 c2 c3 c4 INSERT INTO t2(c1,c2) VALUES(19830907,830907) ON DUPLICATE KEY UPDATE c1=19830909,c2=830910; SELECT * FROM t2 WHERE c1=19830909 AND c2=830910 /* Returns 1 row with c1=19830909,c2=830910 */; c1 c2 c3 c4 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t1 WHERE c1=19830909 AND c2=830910 /* Returns no rows */; c1 c2 c3 c4 INSERT INTO t1(c1,c2) VALUES(19840905,830907) ON DUPLICATE KEY UPDATE c1=19830909,c2=830910; SELECT * FROM t1 WHERE c1=19830909 AND c2=830910 /* Returns 1 row */; c1 c2 c3 c4 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t3 WHERE c1=19830909 AND c2=830910 /* Returns no rows */; c1 c2 c3 c4 INSERT INTO t3(c1,c2) VALUES(19830907,830907) ON DUPLICATE KEY UPDATE c1=19830909,c2=830910; SELECT * FROM t3 WHERE c1=19830909 AND c2=830910 /* Returns 1 row */; c1 c2 c3 c4 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 INSERT INTO t1 SET c1='1999-01-01',c2='1999-01-01'; INSERT INTO t2 SET c1='1999-01-01',c2='1999-01-01'; INSERT INTO t3 SET c1='1999-01-01'; INSERT INTO t4 SET c2='1999-01-01'; SELECT * FROM t1 WHERE c1='1999-01-01' AND c2='1999-01-01' /* Returns 1 row with values for other column as NULL */; c1 c2 c3 c4 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL SELECT * FROM t2 WHERE c1='1999-01-01' AND c2='1999-01-01' /* Returns 1 row with values for other column as NULL */; c1 c2 c3 c4 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL SELECT * FROM t3 WHERE c1='1999-01-01' /* Returns 1 row with values for other column as NULL */; c1 c2 c3 c4 1999-01-01 00:00:00 NULL NULL NULL SELECT * FROM t4 WHERE c2='1999-01-01' /* Returns 1 row with values for other column as NULL */; c1 c2 c3 c4 2009-01-29 11:11:27 1999-01-01 00:00:00 NULL NULL CREATE TABLE t5(c1 TIMESTAMP NOT NULL, c2 TIMESTAMP NULL, c3 DATE, c4 DATETIME, INDEX idx(c1,c2)); INSERT INTO t5 SELECT * FROM t1 WHERE c1 >=0 AND c1 < '20070523091528'; SELECT * FROM t5; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL TRUNCATE TABLE t5; INSERT INTO t5 SELECT * FROM t2 WHERE c1 >='98-12-31 11:30:45' AND c1 < '20070523091528' AND c2 <> '070525'; SELECT * FROM t5; c1 c2 c3 c4 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL TRUNCATE TABLE t5; INSERT INTO t5 SELECT * FROM t3 WHERE c2 BETWEEN 0 AND '1998-12-30 11:30:45'; SELECT * FROM t5; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 TRUNCATE TABLE t5; DROP TABLE t5; INSERT INTO t1 VALUES('1971-01-01 00:00:01','1980-01-01 00:00:01','2009-01-01','2009-01-02'),('1990-01-01 00:00:01','2000-01-01 00:00:01','2009-01-03','2009-01-04'),('2038-01-09 03:14:07','2038-01-09 03:14:07','2009-01-05','2009-01-06'); INSERT INTO t2 VALUES('1971-01-01 00:00:01','1980-01-01 00:00:01','2009-01-01','2009-01-02'),('1990-01-01 00:00:01','2000-01-01 00:00:01','2009-01-03','2009-01-04'),('2038-01-09 03:14:07','2038-01-09 03:14:07','2009-01-05','2009-01-06'); INSERT INTO t3 VALUES('1971-01-01 00:00:01','1980-01-01 00:00:01','2009-01-01','2009-01-02'),('1990-01-01 00:00:01','2000-01-01 00:00:01','2009-01-03','2009-01-04'),('2038-01-09 03:14:07','2038-01-09 03:14:07','2009-01-05','2009-01-06'); INSERT INTO t4 VALUES('1971-01-01 00:00:01','1980-01-01 00:00:01','2009-01-01','2009-01-02'),('1990-01-01 00:00:01','2000-01-01 00:00:01','2009-01-03','2009-01-04'),('2038-01-09 03:14:07','2038-01-09 03:14:07','2009-01-05','2009-01-06'); INSERT INTO t4(c1,c2) VALUES('2010-00-01','2010-10-00'); Warnings: Warning 1265 Data truncated for column 'c1' at row 1 Warning 1265 Data truncated for column 'c2' at row 1 INSERT INTO t4(c1) VALUES('2009-02-30'),('2009-04-31'),('2009-06-31'),('2009-09-31'),('2009-11-31'),('2009-13-01'),('2009-12-32'),('2009-01-01 23:60:60'),('2009-01-01 24:59:59'),('2009-01-01 23:59:60'); Warnings: Warning 1265 Data truncated for column 'c1' at row 1 Warning 1265 Data truncated for column 'c1' at row 2 Warning 1265 Data truncated for column 'c1' at row 3 Warning 1265 Data truncated for column 'c1' at row 4 Warning 1265 Data truncated for column 'c1' at row 5 Warning 1265 Data truncated for column 'c1' at row 6 Warning 1265 Data truncated for column 'c1' at row 7 Warning 1265 Data truncated for column 'c1' at row 8 Warning 1265 Data truncated for column 'c1' at row 9 Warning 1265 Data truncated for column 'c1' at row 10 DELETE FROM t1 WHERE c1=NOW() /* because the row with current timestamp exists */; INSERT INTO t1 VALUES(NULL,NOW(),NOW(),NOW()); Warnings: Note 1265 Data truncated for column 'c3' at row 1 SELECT * FROM t1 WHERE c1 IS NULL /* returns no rows */; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1=NOW() /* returns 1 row */; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 INSERT INTO t2(c1) VALUES(NULL); INSERT INTO t3 VALUES(NULL,'2008-01-14 00:00:00','08-01-15','08/01/16'); INSERT INTO t4 VALUES(NULL,'2008-01-14 00:00:00','08-01-15','08/01/16'); SET SQL_MODE=STRICT_ALL_TABLES; INSERT INTO t4 SET c2='1999-01-01' /* NOT NULL column will get the default value as current timestamp */; SET SQL_MODE=''; SELECT * FROM t1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t4; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-10 2008-01-11 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-12 2008-01-13 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 NULL NULL 0000-00-00 00:00:00 NULL NULL NULL 0000-00-00 00:00:00 NULL NULL NULL 0000-00-00 00:00:00 NULL NULL NULL 0000-00-00 00:00:00 NULL NULL NULL 0000-00-00 00:00:00 NULL NULL NULL 0000-00-00 00:00:00 NULL NULL NULL 0000-00-00 00:00:00 NULL NULL NULL 0000-00-00 00:00:00 NULL NULL NULL 0000-00-00 00:00:00 NULL NULL NULL 0000-00-00 00:00:00 NULL NULL NULL 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-07 00:00:00 1983-09-07 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 1999-01-01 00:00:00 NULL NULL 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t1; total_rows min_value max(c1) 15 0000-00-00 00:00:00 2038-01-09 03:14:07 SELECT * FROM t1 WHERE c3 = '2007-05-24'; c1 c2 c3 c4 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT c1 FROM t1; c1 0000-00-00 00:00:00 1971-01-01 00:00:01 1983-09-05 13:28:00 1983-09-09 00:00:00 1990-01-01 00:00:01 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 2007-05-23 09:15:28 2007-05-27 00:00:00 2008-01-01 00:00:00 2009-01-29 11:11:27 2038-01-09 03:14:07 SELECT c1 FROM t1 ORDER BY c1 DESC; c1 2038-01-09 03:14:07 2009-01-29 11:11:27 2008-01-01 00:00:00 2007-05-27 00:00:00 2007-05-23 09:15:28 1999-01-01 00:00:00 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-28 00:00:00 1990-01-01 00:00:01 1983-09-09 00:00:00 1983-09-05 13:28:00 1971-01-01 00:00:01 0000-00-00 00:00:00 SELECT * FROM t1 ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 = '1971-01-01 00:00:01' ORDER BY c1; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 = '1971-01-01 00:00:01' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 = '1971-01-01 00:00:01' ORDER BY c1 DESC; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 = '1971-01-01 00:00:01' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 <> '1971-01-01 00:00:01' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c1 <> '1971-01-01 00:00:01' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 > '1971-01-01 00:00:01' ORDER BY c1; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c1 > '1971-01-01 00:00:01' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t1 WHERE c1 >= '1971-01-01 00:00:01' ORDER BY c1; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c1 >= '1971-01-01 00:00:01' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 < '1971-01-01 00:00:01' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 < '1971-01-01 00:00:01' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <= '1971-01-01 00:00:01' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 <= '1971-01-01 00:00:01' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 <=> '1971-01-01 00:00:01' ORDER BY c1; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 <=> '1971-01-01 00:00:01' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '1971-01-01 00:00:01' AND '2038-01-09 03:14:07' ORDER BY c1; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '1971-01-01 00:00:01' AND '2038-01-09 03:14:07' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 IN ('1971-01-01 00:00:01','2038-01-09 03:14:07') ORDER BY c1; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c1 IN ('1971-01-01 00:00:01','2038-01-09 03:14:07') ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c1 >= '1971-01-01 00:00:01' AND c1 < '2038-01-09 03:14:07' AND c2 = '2038-01-09 03:14:07' ORDER BY c1; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 >= '1971-01-01 00:00:01' AND c1 < '2038-01-09 03:14:07' AND c2 = '2038-01-09 03:14:07' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 <> '1971-01-01 00:00:01' ORDER BY c1 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <> '1971-01-01 00:00:01' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 > '1971-01-01 00:00:01' ORDER BY c1 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 > '1971-01-01 00:00:01' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 >= '1971-01-01 00:00:01' ORDER BY c1 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 >= '1971-01-01 00:00:01' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 < '1971-01-01 00:00:01' ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 < '1971-01-01 00:00:01' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <= '1971-01-01 00:00:01' ORDER BY c1 DESC; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <= '1971-01-01 00:00:01' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <=> '1971-01-01 00:00:01' ORDER BY c1 DESC; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 <=> '1971-01-01 00:00:01' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '1971-01-01 00:00:01' AND '2038-01-09 03:14:07' ORDER BY c1 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '1971-01-01 00:00:01' AND '2038-01-09 03:14:07' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 IN ('1971-01-01 00:00:01','2038-01-09 03:14:07') ORDER BY c1 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 IN ('1971-01-01 00:00:01','2038-01-09 03:14:07') ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 >= '1971-01-01 00:00:01' AND c1 < '2038-01-09 03:14:07' AND c2 = '2038-01-09 03:14:07' ORDER BY c1 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 >= '1971-01-01 00:00:01' AND c1 < '2038-01-09 03:14:07' AND c2 = '2038-01-09 03:14:07' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 SELECT * FROM t1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t1; total_rows min_value max(c1) 15 0000-00-00 00:00:00 2038-01-09 03:14:07 SELECT * FROM t1 WHERE c3 = '2007-05-26'; c1 c2 c3 c4 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT c1 FROM t1; c1 0000-00-00 00:00:00 1971-01-01 00:00:01 1983-09-05 13:28:00 1983-09-09 00:00:00 1990-01-01 00:00:01 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 2007-05-23 09:15:28 2007-05-27 00:00:00 2008-01-01 00:00:00 2009-01-29 11:11:27 2038-01-09 03:14:07 SELECT c1 FROM t1 ORDER BY c1 DESC; c1 2038-01-09 03:14:07 2009-01-29 11:11:27 2008-01-01 00:00:00 2007-05-27 00:00:00 2007-05-23 09:15:28 1999-01-01 00:00:00 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-28 00:00:00 1990-01-01 00:00:01 1983-09-09 00:00:00 1983-09-05 13:28:00 1971-01-01 00:00:01 0000-00-00 00:00:00 SELECT * FROM t1 ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 = '0000-00-00 00:00:00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 = '0000-00-00 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 = '0000-00-00 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 = '0000-00-00 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <> '0000-00-00 00:00:00' ORDER BY c1; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c1 <> '0000-00-00 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 > '0000-00-00 00:00:00' ORDER BY c1; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c1 > '0000-00-00 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00 00:00:00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 < '0000-00-00 00:00:00' ORDER BY c1; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 < '0000-00-00 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 <= '0000-00-00 00:00:00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <= '0000-00-00 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <=> '0000-00-00 00:00:00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <=> '0000-00-00 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00 00:00:00' AND '2038-01-09 03:14:07' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00 00:00:00' AND '2038-01-09 03:14:07' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00 00:00:00','2038-01-09 03:14:07') ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00 00:00:00','2038-01-09 03:14:07') ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00 00:00:00' AND c1 < '2038-01-09 03:14:07' AND c2 = '2010-10-00 00:00:00' ORDER BY c1; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t1 WHERE c1 >= '0000-00-00 00:00:00' AND c1 < '2038-01-09 03:14:07' AND c2 = '2010-10-00 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 <> '0000-00-00 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 <> '0000-00-00 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 > '0000-00-00 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 > '0000-00-00 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 >= '0000-00-00 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 < '0000-00-00 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 < '0000-00-00 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 <= '0000-00-00 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <= '0000-00-00 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <=> '0000-00-00 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 <=> '0000-00-00 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00 00:00:00' AND '2038-01-09 03:14:07' ORDER BY c1 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00 00:00:00' AND '2038-01-09 03:14:07' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 IN ('0000-00-00 00:00:00','2038-01-09 03:14:07') ORDER BY c1 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IN ('0000-00-00 00:00:00','2038-01-09 03:14:07') ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 >= '0000-00-00 00:00:00' AND c1 < '2038-01-09 03:14:07' AND c2 = '2010-10-00 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t1 WHERE c1 >= '0000-00-00 00:00:00' AND c1 < '2038-01-09 03:14:07' AND c2 = '2010-10-00 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 SELECT * FROM t1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t1; total_rows min_value max(c1) 15 0000-00-00 00:00:00 2038-01-09 03:14:07 SELECT * FROM t1 WHERE c3 = '1998-12-28'; c1 c2 c3 c4 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT c1 FROM t1; c1 0000-00-00 00:00:00 1971-01-01 00:00:01 1983-09-05 13:28:00 1983-09-09 00:00:00 1990-01-01 00:00:01 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 2007-05-23 09:15:28 2007-05-27 00:00:00 2008-01-01 00:00:00 2009-01-29 11:11:27 2038-01-09 03:14:07 SELECT c1 FROM t1 ORDER BY c1 DESC; c1 2038-01-09 03:14:07 2009-01-29 11:11:27 2008-01-01 00:00:00 2007-05-27 00:00:00 2007-05-23 09:15:28 1999-01-01 00:00:00 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-28 00:00:00 1990-01-01 00:00:01 1983-09-09 00:00:00 1983-09-05 13:28:00 1971-01-01 00:00:01 0000-00-00 00:00:00 SELECT * FROM t1 ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1 = '2010-00-01 00:00:00' ORDER BY c1; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 = '2010-00-01 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 = '2010-00-01 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 = '2010-00-01 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 <> '2010-00-01 00:00:00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 <> '2010-00-01 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 > '2010-00-01 00:00:00' ORDER BY c1; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 > '2010-00-01 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 >= '2010-00-01 00:00:00' ORDER BY c1; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 >= '2010-00-01 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 < '2010-00-01 00:00:00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 < '2010-00-01 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 <= '2010-00-01 00:00:00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 <= '2010-00-01 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 <=> '2010-00-01 00:00:00' ORDER BY c1; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 <=> '2010-00-01 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01 00:00:00' ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','2010-00-01 00:00:00') ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','2010-00-01 00:00:00') ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01 00:00:00' AND c2 = '2010-10-00 00:00:00' ORDER BY c1; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01 00:00:00' AND c2 = '2010-10-00 00:00:00' ORDER BY c1 LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c1 <> '2010-00-01 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 <> '2010-00-01 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 > '2010-00-01 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 > '2010-00-01 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 >= '2010-00-01 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 >= '2010-00-01 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 < '2010-00-01 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 < '2010-00-01 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 <= '2010-00-01 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 <= '2010-00-01 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 <=> '2010-00-01 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 <=> '2010-00-01 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','2010-00-01 00:00:00') ORDER BY c1 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 IN ('0000-00-00','2010-00-01 00:00:00') ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01 00:00:00' AND c2 = '2010-10-00 00:00:00' ORDER BY c1 DESC; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t1 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01 00:00:00' AND c2 = '2010-10-00 00:00:00' ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NULL ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c1 IS NOT NULL ORDER BY c1 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 SELECT * FROM t1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t1; total_rows min_value max(c2) 15 0000-00-00 00:00:00 2038-01-09 03:14:07 SELECT * FROM t1 WHERE c4 = '2009-01-29'; c1 c2 c3 c4 SELECT c2 FROM t1; c2 0000-00-00 00:00:00 1980-01-01 00:00:01 1983-09-05 13:28:00 1983-09-10 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 2000-01-01 00:00:01 2007-05-23 09:15:28 2007-05-25 00:00:00 2009-01-29 11:11:27 2038-01-09 03:14:07 NULL SELECT c2 FROM t1 ORDER BY c2 DESC; c2 2038-01-09 03:14:07 2009-01-29 11:11:27 2007-05-25 00:00:00 2007-05-23 09:15:28 2000-01-01 00:00:01 1999-01-01 00:00:00 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-28 00:00:00 1983-09-10 00:00:00 1983-09-05 13:28:00 1980-01-01 00:00:01 0000-00-00 00:00:00 NULL SELECT * FROM t1 ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 = '2038-01-09 03:14:07' ORDER BY c2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c2 = '2038-01-09 03:14:07' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c2 = '2038-01-09 03:14:07' ORDER BY c2 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c2 = '2038-01-09 03:14:07' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c2 <> '2038-01-09 03:14:07' ORDER BY c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 <> '2038-01-09 03:14:07' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c2 > '2038-01-09 03:14:07' ORDER BY c2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 > '2038-01-09 03:14:07' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 >= '2038-01-09 03:14:07' ORDER BY c2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c2 >= '2038-01-09 03:14:07' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c2 < '2038-01-09 03:14:07' ORDER BY c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 < '2038-01-09 03:14:07' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c2 <= '2038-01-09 03:14:07' ORDER BY c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c2 <= '2038-01-09 03:14:07' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c2 <=> '2038-01-09 03:14:07' ORDER BY c2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c2 <=> '2038-01-09 03:14:07' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c2 BETWEEN '1971-01-01 00:00:01' AND '2038-01-09 03:14:07' ORDER BY c2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c2 BETWEEN '1971-01-01 00:00:01' AND '2038-01-09 03:14:07' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t1 WHERE c2 IN ('1971-01-01 00:00:01','2038-01-09 03:14:07') ORDER BY c2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c2 IN ('1971-01-01 00:00:01','2038-01-09 03:14:07') ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c2 >= '1971-01-01 00:00:01' AND c2 < '2038-01-09 03:14:07' AND c1 = '2038-01-09 03:14:07' ORDER BY c2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 >= '1971-01-01 00:00:01' AND c2 < '2038-01-09 03:14:07' AND c1 = '2038-01-09 03:14:07' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c2 <> '2038-01-09 03:14:07' ORDER BY c2 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 <> '2038-01-09 03:14:07' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT * FROM t1 WHERE c2 > '2038-01-09 03:14:07' ORDER BY c2 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 > '2038-01-09 03:14:07' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 >= '2038-01-09 03:14:07' ORDER BY c2 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c2 >= '2038-01-09 03:14:07' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c2 < '2038-01-09 03:14:07' ORDER BY c2 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 < '2038-01-09 03:14:07' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT * FROM t1 WHERE c2 <= '2038-01-09 03:14:07' ORDER BY c2 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 <= '2038-01-09 03:14:07' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 <=> '2038-01-09 03:14:07' ORDER BY c2 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c2 <=> '2038-01-09 03:14:07' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c2 BETWEEN '1971-01-01 00:00:01' AND '2038-01-09 03:14:07' ORDER BY c2 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c2 BETWEEN '1971-01-01 00:00:01' AND '2038-01-09 03:14:07' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 IN ('1971-01-01 00:00:01','2038-01-09 03:14:07') ORDER BY c2 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c2 IN ('1971-01-01 00:00:01','2038-01-09 03:14:07') ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c2 >= '1971-01-01 00:00:01' AND c2 < '2038-01-09 03:14:07' AND c1 = '2038-01-09 03:14:07' ORDER BY c2 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 >= '1971-01-01 00:00:01' AND c2 < '2038-01-09 03:14:07' AND c1 = '2038-01-09 03:14:07' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2 DESC; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 SELECT * FROM t1; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t1; total_rows min_value max(c2) 15 0000-00-00 00:00:00 2038-01-09 03:14:07 SELECT * FROM t1 WHERE c4 = '2008-01-05'; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT c2 FROM t1; c2 0000-00-00 00:00:00 1980-01-01 00:00:01 1983-09-05 13:28:00 1983-09-10 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 2000-01-01 00:00:01 2007-05-23 09:15:28 2007-05-25 00:00:00 2009-01-29 11:11:27 2038-01-09 03:14:07 NULL SELECT c2 FROM t1 ORDER BY c2 DESC; c2 2038-01-09 03:14:07 2009-01-29 11:11:27 2007-05-25 00:00:00 2007-05-23 09:15:28 2000-01-01 00:00:01 1999-01-01 00:00:00 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-28 00:00:00 1983-09-10 00:00:00 1983-09-05 13:28:00 1980-01-01 00:00:01 0000-00-00 00:00:00 NULL SELECT * FROM t1 ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 = '2010-10-01 00:00:00' ORDER BY c2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 = '2010-10-01 00:00:00' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 = '2010-10-01 00:00:00' ORDER BY c2 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 = '2010-10-01 00:00:00' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 <> '2010-10-01 00:00:00' ORDER BY c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c2 <> '2010-10-01 00:00:00' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c2 > '2010-10-01 00:00:00' ORDER BY c2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c2 > '2010-10-01 00:00:00' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c2 >= '2010-10-01 00:00:00' ORDER BY c2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c2 >= '2010-10-01 00:00:00' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c2 < '2010-10-01 00:00:00' ORDER BY c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 < '2010-10-01 00:00:00' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c2 <= '2010-10-01 00:00:00' ORDER BY c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 <= '2010-10-01 00:00:00' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c2 <=> '2010-10-01 00:00:00' ORDER BY c2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 <=> '2010-10-01 00:00:00' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 BETWEEN '1971-01-01 00:00:01' AND '2010-10-00 00:00:00' ORDER BY c2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t1 WHERE c2 BETWEEN '1971-01-01 00:00:01' AND '2010-10-00 00:00:00' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t1 WHERE c2 IN ('1971-01-01 00:00:01','2010-10-00 00:00:00') ORDER BY c2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t1 WHERE c2 IN ('1971-01-01 00:00:01','2010-10-00 00:00:00') ORDER BY c2 LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t1 WHERE c2 >= '1971-01-01 00:00:01' AND c2 < '2010-10-00 00:00:00' AND c1 = '2010-00-01 00:00:00' ORDER BY c2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c2 >= '1971-01-01 00:00:01' AND c2 < '2010-10-00 00:00:00' AND c1 = '2010-00-01 00:00:00' ORDER BY c2 LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2 LIMIT 2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t1 WHERE c2 <> '2010-10-01 00:00:00' ORDER BY c2 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 <> '2010-10-01 00:00:00' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c2 > '2010-10-01 00:00:00' ORDER BY c2 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c2 > '2010-10-01 00:00:00' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c2 >= '2010-10-01 00:00:00' ORDER BY c2 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c2 >= '2010-10-01 00:00:00' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t1 WHERE c2 < '2010-10-01 00:00:00' ORDER BY c2 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 < '2010-10-01 00:00:00' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT * FROM t1 WHERE c2 <= '2010-10-01 00:00:00' ORDER BY c2 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 <= '2010-10-01 00:00:00' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT * FROM t1 WHERE c2 <=> '2010-10-01 00:00:00' ORDER BY c2 DESC; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 <=> '2010-10-01 00:00:00' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t1 WHERE c2 BETWEEN '1971-01-01 00:00:01' AND '2010-10-00 00:00:00' ORDER BY c2 DESC; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t1 WHERE c2 BETWEEN '1971-01-01 00:00:01' AND '2010-10-00 00:00:00' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t1 WHERE c2 IN ('1971-01-01 00:00:01','2010-10-00 00:00:00') ORDER BY c2 DESC; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t1 WHERE c2 IN ('1971-01-01 00:00:01','2010-10-00 00:00:00') ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t1 WHERE c2 >= '1971-01-01 00:00:01' AND c2 < '2010-10-00 00:00:00' AND c1 = '2010-00-01 00:00:00' ORDER BY c2 DESC; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c2 >= '1971-01-01 00:00:01' AND c2 < '2010-10-00 00:00:00' AND c1 = '2010-00-01 00:00:00' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2 DESC; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NULL ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 2007-05-27 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-04 2008-01-05 00:00:00 SELECT * FROM t1 WHERE c2 IS NOT NULL ORDER BY c2 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 2009-01-29 11:11:27 2009-01-29 11:11:27 2009-01-29 2009-01-29 11:11:27 SELECT * FROM t1 WHERE c1='1971-01-01 00:00:01' OR c2='2038-01-09 03:14:07'; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT c2 FROM t1 GROUP BY c2; c2 0000-00-00 00:00:00 1980-01-01 00:00:01 1983-09-05 13:28:00 1983-09-10 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 2000-01-01 00:00:01 2007-05-23 09:15:28 2007-05-25 00:00:00 2009-01-29 11:11:27 2038-01-09 03:14:07 NULL SELECT * FROM t2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t2; total_rows min_value max(c1) 18 0000-00-00 00:00:00 2038-01-09 03:14:07 SELECT * FROM t2 WHERE c3 = '2007-05-24'; c1 c2 c3 c4 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT c1,c2 FROM t2; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 SELECT c1,c2 FROM t2 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 SELECT * FROM t2 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '1971-01-01 00:00:01' ORDER BY c1,c2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t2 WHERE c1 = '1971-01-01 00:00:01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t2 WHERE c1 = '1971-01-01 00:00:01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t2 WHERE c1 = '1971-01-01 00:00:01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t2 WHERE c1 <> '1971-01-01 00:00:01' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 <> '1971-01-01 00:00:01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 > '1971-01-01 00:00:01' ORDER BY c1,c2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 > '1971-01-01 00:00:01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t2 WHERE c1 >= '1971-01-01 00:00:01' ORDER BY c1,c2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 >= '1971-01-01 00:00:01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c1 < '1971-01-01 00:00:01' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 < '1971-01-01 00:00:01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '1971-01-01 00:00:01' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t2 WHERE c1 <= '1971-01-01 00:00:01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '1971-01-01 00:00:01' ORDER BY c1,c2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t2 WHERE c1 <=> '1971-01-01 00:00:01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '1971-01-01 00:00:01' AND '2038-01-09 03:14:07' ORDER BY c1,c2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '1971-01-01 00:00:01' AND '2038-01-09 03:14:07' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c1 IN ('1971-01-01 00:00:01','2038-01-09 03:14:07') ORDER BY c1,c2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 IN ('1971-01-01 00:00:01','2038-01-09 03:14:07') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 >= '1971-01-01 00:00:01' AND c1 < '2038-01-09 03:14:07' AND c2 = '2038-01-09 03:14:07' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 >= '1971-01-01 00:00:01' AND c1 < '2038-01-09 03:14:07' AND c2 = '2038-01-09 03:14:07' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <> '1971-01-01 00:00:01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 <> '1971-01-01 00:00:01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 > '1971-01-01 00:00:01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 > '1971-01-01 00:00:01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t2 WHERE c1 >= '1971-01-01 00:00:01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 >= '1971-01-01 00:00:01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c1 < '1971-01-01 00:00:01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 < '1971-01-01 00:00:01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '1971-01-01 00:00:01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t2 WHERE c1 <= '1971-01-01 00:00:01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '1971-01-01 00:00:01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t2 WHERE c1 <=> '1971-01-01 00:00:01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '1971-01-01 00:00:01' AND '2038-01-09 03:14:07' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '1971-01-01 00:00:01' AND '2038-01-09 03:14:07' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c1 IN ('1971-01-01 00:00:01','2038-01-09 03:14:07') ORDER BY c1,c2 DESC; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 IN ('1971-01-01 00:00:01','2038-01-09 03:14:07') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 >= '1971-01-01 00:00:01' AND c1 < '2038-01-09 03:14:07' AND c2 = '2038-01-09 03:14:07' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 >= '1971-01-01 00:00:01' AND c1 < '2038-01-09 03:14:07' AND c2 = '2038-01-09 03:14:07' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t2; total_rows min_value max(c1) 18 0000-00-00 00:00:00 2038-01-09 03:14:07 SELECT * FROM t2 WHERE c3 = '2007-05-26'; c1 c2 c3 c4 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT c1,c2 FROM t2; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 SELECT c1,c2 FROM t2 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 SELECT * FROM t2 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '0000-00-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '0000-00-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '0000-00-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '0000-00-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <> '0000-00-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 <> '0000-00-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c1 > '0000-00-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 > '0000-00-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 < '0000-00-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 < '0000-00-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 <= '0000-00-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '0000-00-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '0000-00-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '0000-00-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00 00:00:00' AND '2038-01-09 03:14:07' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00 00:00:00' AND '2038-01-09 03:14:07' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IN ('0000-00-00 00:00:00','2038-01-09 03:14:07') ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 IN ('0000-00-00 00:00:00','2038-01-09 03:14:07') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00 00:00:00' AND c1 < '2038-01-09 03:14:07' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t2 WHERE c1 >= '0000-00-00 00:00:00' AND c1 < '2038-01-09 03:14:07' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <> '0000-00-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 <> '0000-00-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c1 > '0000-00-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 > '0000-00-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 < '0000-00-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 < '0000-00-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 <= '0000-00-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <= '0000-00-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '0000-00-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <=> '0000-00-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00 00:00:00' AND '2038-01-09 03:14:07' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00 00:00:00' AND '2038-01-09 03:14:07' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 IN ('0000-00-00 00:00:00','2038-01-09 03:14:07') ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 IN ('0000-00-00 00:00:00','2038-01-09 03:14:07') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 >= '0000-00-00 00:00:00' AND c1 < '2038-01-09 03:14:07' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t2 WHERE c1 >= '0000-00-00 00:00:00' AND c1 < '2038-01-09 03:14:07' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t2; total_rows min_value max(c1) 18 0000-00-00 00:00:00 2038-01-09 03:14:07 SELECT * FROM t2 WHERE c3 = '1998-12-28'; c1 c2 c3 c4 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT c1,c2 FROM t2; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 SELECT c1,c2 FROM t2 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 SELECT * FROM t2 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 = '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 = '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 = '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 = '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 <> '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 <> '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 > '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 > '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 >= '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 >= '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 < '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 < '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 <= '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 <= '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 <=> '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 <=> '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','2010-00-01 00:00:00') ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','2010-00-01 00:00:00') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01 00:00:00' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01 00:00:00' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c1 <> '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 <> '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 > '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 > '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 >= '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 >= '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 < '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 < '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 <= '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 <= '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 <=> '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 <=> '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','2010-00-01 00:00:00') ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 IN ('0000-00-00','2010-00-01 00:00:00') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01 00:00:00' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t2 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01 00:00:00' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t2; total_rows min_value max(c2) 18 0000-00-00 00:00:00 2038-01-09 03:14:07 SELECT * FROM t2 WHERE c4 = '2009-01-29'; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT c1,c2 FROM t2; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 SELECT c1,c2 FROM t2 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 SELECT * FROM t2 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 = '2038-01-09 03:14:07' ORDER BY c1,c2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 = '2038-01-09 03:14:07' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 = '2038-01-09 03:14:07' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 = '2038-01-09 03:14:07' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 <> '2038-01-09 03:14:07' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 <> '2038-01-09 03:14:07' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 > '2038-01-09 03:14:07' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 > '2038-01-09 03:14:07' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 >= '2038-01-09 03:14:07' ORDER BY c1,c2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 >= '2038-01-09 03:14:07' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 < '2038-01-09 03:14:07' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 < '2038-01-09 03:14:07' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <= '2038-01-09 03:14:07' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 <= '2038-01-09 03:14:07' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <=> '2038-01-09 03:14:07' ORDER BY c1,c2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 <=> '2038-01-09 03:14:07' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 BETWEEN '1971-01-01 00:00:01' AND '2038-01-09 03:14:07' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 BETWEEN '1971-01-01 00:00:01' AND '2038-01-09 03:14:07' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t2 WHERE c2 IN ('1971-01-01 00:00:01','2038-01-09 03:14:07') ORDER BY c1,c2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 IN ('1971-01-01 00:00:01','2038-01-09 03:14:07') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 >= '1971-01-01 00:00:01' AND c2 < '2038-01-09 03:14:07' AND c1 = '2038-01-09 03:14:07' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 >= '1971-01-01 00:00:01' AND c2 < '2038-01-09 03:14:07' AND c1 = '2038-01-09 03:14:07' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <> '2038-01-09 03:14:07' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL SELECT * FROM t2 WHERE c2 <> '2038-01-09 03:14:07' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 > '2038-01-09 03:14:07' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 > '2038-01-09 03:14:07' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 >= '2038-01-09 03:14:07' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 >= '2038-01-09 03:14:07' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 < '2038-01-09 03:14:07' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL SELECT * FROM t2 WHERE c2 < '2038-01-09 03:14:07' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <= '2038-01-09 03:14:07' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 <= '2038-01-09 03:14:07' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <=> '2038-01-09 03:14:07' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 <=> '2038-01-09 03:14:07' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 BETWEEN '1971-01-01 00:00:01' AND '2038-01-09 03:14:07' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 BETWEEN '1971-01-01 00:00:01' AND '2038-01-09 03:14:07' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t2 WHERE c2 IN ('1971-01-01 00:00:01','2038-01-09 03:14:07') ORDER BY c1,c2 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 IN ('1971-01-01 00:00:01','2038-01-09 03:14:07') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 >= '1971-01-01 00:00:01' AND c2 < '2038-01-09 03:14:07' AND c1 = '2038-01-09 03:14:07' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 >= '1971-01-01 00:00:01' AND c2 < '2038-01-09 03:14:07' AND c1 = '2038-01-09 03:14:07' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t2; total_rows min_value max(c2) 18 0000-00-00 00:00:00 2038-01-09 03:14:07 SELECT * FROM t2 WHERE c4 = '2008-01-07'; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT c1,c2 FROM t2; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 SELECT c1,c2 FROM t2 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 SELECT * FROM t2 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 = '2010-10-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 = '2010-10-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 = '2010-10-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 = '2010-10-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 <> '2010-10-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 <> '2010-10-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 > '2010-10-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 > '2010-10-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 >= '2010-10-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 >= '2010-10-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 < '2010-10-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 < '2010-10-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <= '2010-10-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 <= '2010-10-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <=> '2010-10-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 <=> '2010-10-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 BETWEEN '1971-01-01 00:00:01' AND '2010-10-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 BETWEEN '1971-01-01 00:00:01' AND '2010-10-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t2 WHERE c2 IN ('1971-01-01 00:00:01','2010-10-00 00:00:00') ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 IN ('1971-01-01 00:00:01','2010-10-00 00:00:00') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 >= '1971-01-01 00:00:01' AND c2 < '2010-10-00 00:00:00' AND c1 = '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c2 >= '1971-01-01 00:00:01' AND c2 < '2010-10-00 00:00:00' AND c1 = '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <> '2010-10-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 <> '2010-10-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 > '2010-10-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 > '2010-10-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 >= '2010-10-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 >= '2010-10-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 < '2010-10-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL SELECT * FROM t2 WHERE c2 < '2010-10-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <= '2010-10-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL SELECT * FROM t2 WHERE c2 <= '2010-10-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t2 WHERE c2 <=> '2010-10-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 <=> '2010-10-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 BETWEEN '1971-01-01 00:00:01' AND '2010-10-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t2 WHERE c2 BETWEEN '1971-01-01 00:00:01' AND '2010-10-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t2 WHERE c2 IN ('1971-01-01 00:00:01','2010-10-00 00:00:00') ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 IN ('1971-01-01 00:00:01','2010-10-00 00:00:00') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 >= '1971-01-01 00:00:01' AND c2 < '2010-10-00 00:00:00' AND c1 = '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c2 >= '1971-01-01 00:00:01' AND c2 < '2010-10-00 00:00:00' AND c1 = '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 1999-01-01 00:00:00 NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 0000-00-00 00:00:00 NULL NULL 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t2 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 2008-01-06 00:00:00 2008-01-06 2008-01-07 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-06 2008-01-07 00:00:00 SELECT * FROM t3; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t3; total_rows min_value max(c1) 19 0000-00-00 00:00:00 2038-01-09 03:14:07 SELECT * FROM t3 WHERE c3 = '2007-05-24'; c1 c2 c3 c4 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 SELECT c1,c2 FROM t3; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 SELECT c1,c2 FROM t3 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1999-01-01 00:00:00 NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 SELECT * FROM t3 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 = '1971-01-01 00:00:01' ORDER BY c1,c2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 = '1971-01-01 00:00:01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 = '1971-01-01 00:00:01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 = '1971-01-01 00:00:01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 <> '1971-01-01 00:00:01' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 <> '1971-01-01 00:00:01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 > '1971-01-01 00:00:01' ORDER BY c1,c2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 > '1971-01-01 00:00:01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t3 WHERE c1 >= '1971-01-01 00:00:01' ORDER BY c1,c2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 >= '1971-01-01 00:00:01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 < '1971-01-01 00:00:01' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 < '1971-01-01 00:00:01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <= '1971-01-01 00:00:01' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 <= '1971-01-01 00:00:01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 <=> '1971-01-01 00:00:01' ORDER BY c1,c2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 <=> '1971-01-01 00:00:01' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '1971-01-01 00:00:01' AND '2038-01-09 03:14:07' ORDER BY c1,c2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '1971-01-01 00:00:01' AND '2038-01-09 03:14:07' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 IN ('1971-01-01 00:00:01','2038-01-09 03:14:07') ORDER BY c1,c2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 IN ('1971-01-01 00:00:01','2038-01-09 03:14:07') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 >= '1971-01-01 00:00:01' AND c1 < '2038-01-09 03:14:07' AND c2 = '2038-01-09 03:14:07' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 >= '1971-01-01 00:00:01' AND c1 < '2038-01-09 03:14:07' AND c2 = '2038-01-09 03:14:07' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 <> '1971-01-01 00:00:01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 <> '1971-01-01 00:00:01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 > '1971-01-01 00:00:01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 > '1971-01-01 00:00:01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 SELECT * FROM t3 WHERE c1 >= '1971-01-01 00:00:01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 >= '1971-01-01 00:00:01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 < '1971-01-01 00:00:01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 < '1971-01-01 00:00:01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <= '1971-01-01 00:00:01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 <= '1971-01-01 00:00:01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 <=> '1971-01-01 00:00:01' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 <=> '1971-01-01 00:00:01' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '1971-01-01 00:00:01' AND '2038-01-09 03:14:07' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '1971-01-01 00:00:01' AND '2038-01-09 03:14:07' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 IN ('1971-01-01 00:00:01','2038-01-09 03:14:07') ORDER BY c1,c2 DESC; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 IN ('1971-01-01 00:00:01','2038-01-09 03:14:07') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 >= '1971-01-01 00:00:01' AND c1 < '2038-01-09 03:14:07' AND c2 = '2038-01-09 03:14:07' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 >= '1971-01-01 00:00:01' AND c1 < '2038-01-09 03:14:07' AND c2 = '2038-01-09 03:14:07' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t3; total_rows min_value max(c1) 19 0000-00-00 00:00:00 2038-01-09 03:14:07 SELECT * FROM t3 WHERE c3 = '2007-05-26'; c1 c2 c3 c4 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 SELECT c1,c2 FROM t3; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 SELECT c1,c2 FROM t3 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1999-01-01 00:00:00 NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 SELECT * FROM t3 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 = '0000-00-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 = '0000-00-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 = '0000-00-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 = '0000-00-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <> '0000-00-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 <> '0000-00-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 > '0000-00-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 > '0000-00-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 < '0000-00-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 < '0000-00-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 <= '0000-00-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <= '0000-00-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <=> '0000-00-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <=> '0000-00-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00 00:00:00' AND '2038-01-09 03:14:07' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00 00:00:00' AND '2038-01-09 03:14:07' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 IN ('0000-00-00 00:00:00','2038-01-09 03:14:07') ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 IN ('0000-00-00 00:00:00','2038-01-09 03:14:07') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00 00:00:00' AND c1 < '2038-01-09 03:14:07' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t3 WHERE c1 >= '0000-00-00 00:00:00' AND c1 < '2038-01-09 03:14:07' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 <> '0000-00-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 <> '0000-00-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 > '0000-00-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 > '0000-00-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 < '0000-00-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 < '0000-00-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 <= '0000-00-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <= '0000-00-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <=> '0000-00-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 <=> '0000-00-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00 00:00:00' AND '2038-01-09 03:14:07' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00 00:00:00' AND '2038-01-09 03:14:07' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 IN ('0000-00-00 00:00:00','2038-01-09 03:14:07') ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 IN ('0000-00-00 00:00:00','2038-01-09 03:14:07') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 >= '0000-00-00 00:00:00' AND c1 < '2038-01-09 03:14:07' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t3 WHERE c1 >= '0000-00-00 00:00:00' AND c1 < '2038-01-09 03:14:07' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT count(*) as total_rows, min(c1) as min_value, max(c1) FROM t3; total_rows min_value max(c1) 19 0000-00-00 00:00:00 2038-01-09 03:14:07 SELECT * FROM t3 WHERE c3 = '1998-12-28'; c1 c2 c3 c4 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 SELECT c1,c2 FROM t3; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 SELECT c1,c2 FROM t3 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1999-01-01 00:00:00 NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 SELECT * FROM t3 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 = '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 = '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 = '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 = '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 <> '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 <> '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 > '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 > '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 >= '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 >= '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 < '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 < '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 <= '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 <= '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 <=> '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 <=> '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','2010-00-01 00:00:00') ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','2010-00-01 00:00:00') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01 00:00:00' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01 00:00:00' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c1 <> '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 <> '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 > '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 > '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 >= '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 >= '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 < '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 < '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 <= '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 <= '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 <=> '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 <=> '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 BETWEEN '0000-00-00' AND '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','2010-00-01 00:00:00') ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 IN ('0000-00-00','2010-00-01 00:00:00') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01 00:00:00' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t3 WHERE c1 >= '0000-00-00' AND c1 < '2010-00-01 00:00:00' AND c2 = '2010-10-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c1 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t3; total_rows min_value max(c2) 19 0000-00-00 00:00:00 2038-01-09 03:14:07 SELECT * FROM t3 WHERE c4 = '2009-01-29'; c1 c2 c3 c4 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT c1,c2 FROM t3; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 SELECT c1,c2 FROM t3 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1999-01-01 00:00:00 NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 SELECT * FROM t3 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 = '2038-01-09 03:14:07' ORDER BY c1,c2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 = '2038-01-09 03:14:07' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 = '2038-01-09 03:14:07' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 = '2038-01-09 03:14:07' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 <> '2038-01-09 03:14:07' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 <> '2038-01-09 03:14:07' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 > '2038-01-09 03:14:07' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 > '2038-01-09 03:14:07' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 >= '2038-01-09 03:14:07' ORDER BY c1,c2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 >= '2038-01-09 03:14:07' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 < '2038-01-09 03:14:07' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 < '2038-01-09 03:14:07' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 <= '2038-01-09 03:14:07' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 <= '2038-01-09 03:14:07' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 <=> '2038-01-09 03:14:07' ORDER BY c1,c2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 <=> '2038-01-09 03:14:07' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 BETWEEN '1971-01-01 00:00:01' AND '2038-01-09 03:14:07' ORDER BY c1,c2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 BETWEEN '1971-01-01 00:00:01' AND '2038-01-09 03:14:07' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 IN ('1971-01-01 00:00:01','2038-01-09 03:14:07') ORDER BY c1,c2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 IN ('1971-01-01 00:00:01','2038-01-09 03:14:07') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 >= '1971-01-01 00:00:01' AND c2 < '2038-01-09 03:14:07' AND c1 = '2038-01-09 03:14:07' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 >= '1971-01-01 00:00:01' AND c2 < '2038-01-09 03:14:07' AND c1 = '2038-01-09 03:14:07' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 1999-01-01 00:00:00 NULL NULL NULL 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1999-01-01 00:00:00 NULL NULL NULL 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 <> '2038-01-09 03:14:07' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 SELECT * FROM t3 WHERE c2 <> '2038-01-09 03:14:07' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 > '2038-01-09 03:14:07' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 > '2038-01-09 03:14:07' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 >= '2038-01-09 03:14:07' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 >= '2038-01-09 03:14:07' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 < '2038-01-09 03:14:07' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 SELECT * FROM t3 WHERE c2 < '2038-01-09 03:14:07' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 <= '2038-01-09 03:14:07' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 <= '2038-01-09 03:14:07' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 <=> '2038-01-09 03:14:07' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 <=> '2038-01-09 03:14:07' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 BETWEEN '1971-01-01 00:00:01' AND '2038-01-09 03:14:07' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 BETWEEN '1971-01-01 00:00:01' AND '2038-01-09 03:14:07' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 IN ('1971-01-01 00:00:01','2038-01-09 03:14:07') ORDER BY c1,c2 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 IN ('1971-01-01 00:00:01','2038-01-09 03:14:07') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 >= '1971-01-01 00:00:01' AND c2 < '2038-01-09 03:14:07' AND c1 = '2038-01-09 03:14:07' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 >= '1971-01-01 00:00:01' AND c2 < '2038-01-09 03:14:07' AND c1 = '2038-01-09 03:14:07' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 1999-01-01 00:00:00 NULL NULL NULL 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1999-01-01 00:00:00 NULL NULL NULL 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL NULL NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t3; total_rows min_value max(c2) 19 0000-00-00 00:00:00 2038-01-09 03:14:07 SELECT * FROM t3 WHERE c4 = '2008-01-09'; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 SELECT c1,c2 FROM t3; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 SELECT c1,c2 FROM t3 ORDER BY c1,c2 DESC; c1 c2 0000-00-00 00:00:00 0000-00-00 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1999-01-01 00:00:00 NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 SELECT * FROM t3 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 = '2010-10-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 = '2010-10-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 = '2010-10-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 = '2010-10-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 <> '2010-10-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 <> '2010-10-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 > '2010-10-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 > '2010-10-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 >= '2010-10-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 >= '2010-10-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 < '2010-10-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 < '2010-10-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 <= '2010-10-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 <= '2010-10-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 <=> '2010-10-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 <=> '2010-10-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 BETWEEN '1971-01-01 00:00:01' AND '2010-10-00 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 SELECT * FROM t3 WHERE c2 BETWEEN '1971-01-01 00:00:01' AND '2010-10-00 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 IN ('1971-01-01 00:00:01','2010-10-00 00:00:00') ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 IN ('1971-01-01 00:00:01','2010-10-00 00:00:00') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 >= '1971-01-01 00:00:01' AND c2 < '2010-10-00 00:00:00' AND c1 = '2010-00-01 00:00:00' ORDER BY c1,c2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c2 >= '1971-01-01 00:00:01' AND c2 < '2010-10-00 00:00:00' AND c1 = '2010-00-01 00:00:00' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2; c1 c2 c3 c4 1999-01-01 00:00:00 NULL NULL NULL 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 1999-01-01 00:00:00 NULL NULL NULL 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 <> '2010-10-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 <> '2010-10-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 > '2010-10-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 > '2010-10-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 >= '2010-10-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 >= '2010-10-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 < '2010-10-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 SELECT * FROM t3 WHERE c2 < '2010-10-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 <= '2010-10-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 SELECT * FROM t3 WHERE c2 <= '2010-10-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT * FROM t3 WHERE c2 <=> '2010-10-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 <=> '2010-10-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 BETWEEN '1971-01-01 00:00:01' AND '2010-10-00 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 SELECT * FROM t3 WHERE c2 BETWEEN '1971-01-01 00:00:01' AND '2010-10-00 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 SELECT * FROM t3 WHERE c2 IN ('1971-01-01 00:00:01','2010-10-00 00:00:00') ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 IN ('1971-01-01 00:00:01','2010-10-00 00:00:00') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 >= '1971-01-01 00:00:01' AND c2 < '2010-10-00 00:00:00' AND c1 = '2010-00-01 00:00:00' ORDER BY c1,c2 DESC; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c2 >= '1971-01-01 00:00:01' AND c2 < '2010-10-00 00:00:00' AND c1 = '2010-00-01 00:00:00' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 Warnings: Warning 1292 Incorrect datetime value: '2010-10-00 00:00:00' for column 'c2' at row 1 Warning 1292 Incorrect datetime value: '2010-00-01 00:00:00' for column 'c1' at row 1 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 1999-01-01 00:00:00 NULL NULL NULL 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 1999-01-01 00:00:00 NULL NULL NULL 2008-01-01 00:00:00 NULL 2008-01-02 2008-01-03 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-06 1983-09-06 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1983-09-08 1983-09-08 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 2009-01-03 2009-01-04 00:00:00 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-28 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-29 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-30 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-31 1998-12-31 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1998-12-31 1998-12-31 11:30:45 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-24 2007-05-24 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2007-05-26 2007-05-26 00:00:00 2008-01-06 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 2009-01-29 11:11:27 2009-01-29 00:00:00 2009-01-29 2009-01-29 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2008-01-15 2008-01-16 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 2009-01-05 2009-01-06 00:00:00 SELECT * FROM t3 WHERE c2 IS NOT NULL ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 0000-00-00 00:00:00 0000-00-00 00:00:00 2008-01-08 2008-01-09 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 2009-01-01 2009-01-02 00:00:00 SELECT c1 FROM t3 GROUP BY c1; c1 0000-00-00 00:00:00 1971-01-01 00:00:01 1983-09-05 13:28:00 1983-09-09 00:00:00 1990-01-01 00:00:01 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 2007-05-23 09:15:28 2007-05-25 00:00:00 2008-01-01 00:00:00 2008-01-06 00:00:00 2009-01-29 11:11:27 2038-01-09 03:14:07 SELECT DISTINCT c1 FROM t3; c1 0000-00-00 00:00:00 1971-01-01 00:00:01 1983-09-05 13:28:00 1983-09-09 00:00:00 1990-01-01 00:00:01 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-31 11:30:45 1999-01-01 00:00:00 2007-05-23 09:15:28 2007-05-25 00:00:00 2008-01-01 00:00:00 2008-01-06 00:00:00 2009-01-29 11:11:27 2038-01-09 03:14:07 SELECT c1,MIN(c2) FROM t3 GROUP BY c1; c1 MIN(c2) 0000-00-00 00:00:00 0000-00-00 00:00:00 1971-01-01 00:00:01 1980-01-01 00:00:01 1983-09-05 13:28:00 1983-09-05 13:28:00 1983-09-09 00:00:00 1983-09-10 00:00:00 1990-01-01 00:00:01 2000-01-01 00:00:01 1998-12-28 00:00:00 1998-12-28 00:00:00 1998-12-29 00:00:00 1998-12-29 00:00:00 1998-12-30 11:30:45 1998-12-30 11:30:45 1998-12-31 11:30:45 1998-12-30 11:30:45 1999-01-01 00:00:00 NULL 2007-05-23 09:15:28 2007-05-23 09:15:28 2007-05-25 00:00:00 2007-05-25 00:00:00 2008-01-01 00:00:00 NULL 2008-01-06 00:00:00 0000-00-00 00:00:00 2009-01-29 11:11:27 2008-01-14 00:00:00 2038-01-09 03:14:07 2038-01-09 03:14:07 DROP TABLE t1,t2,t3,t4;