1 echo Create table t1(f1 timestamp, f2 timestamp);
2 Create table t1(f1 timestamp, f2 timestamp);
3 insert into t1 values('2001-01-01 01:01:01', '2010-08-01 02:01:01');
4 insert into t1 values('2002-01-01 01:01:01', '2010-09-01 01:01:01');
5 insert into t1 values('2003-01-01 01:01:01', '2010-10-01 01:01:01');
6 insert into t1 values('2004-01-01 01:01:01', '2010-11-01 01:01:01');
7 insert into t1 values('2005-01-01 01:01:01', '2010-12-01 01:01:01');
10 echo select * from t1 where timestamp_sub(f2 interval 10 month) ='2009-12-01 01:01:01';
11 select * from t1 where timestamp_sub(f2 interval 10 month) ='2009-12-01 01:01:01';
12 echo select * from t1 where timestamp_sub(f2 interval 10 month)<='2009-12-01 01:01:01';
13 select * from t1 where timestamp_sub(f2 interval 10 month)<='2009-12-01 01:01:01';
14 echo select * from t1 where timestamp_sub(f2 interval 10 month) >'2009-12-01 01:01:01';
15 select * from t1 where timestamp_sub(f2 interval 10 month) >'2009-12-01 01:01:01';
16 echo select * from t1 where timestamp_sub(f2 interval 10 month)!='2009-12-01 01:01:01';
17 select * from t1 where timestamp_sub(f2 interval 10 month)!='2009-12-01 01:01:01';
18 echo select * from t1 where timestamp_sub(f2 interval 130 month) ='1999-12-01 01:01:01';
19 select * from t1 where timestamp_sub(f2 interval 130 month) ='1999-12-01 01:01:01';
20 echo select * from t1 where timestamp_sub(f2 interval 130 month)<='1999-12-01 01:01:01';
21 select * from t1 where timestamp_sub(f2 interval 130 month)<='1999-12-01 01:01:01';
22 echo select * from t1 where timestamp_sub(f2 interval 130 month) >'1999-12-01 01:01:01';
23 select * from t1 where timestamp_sub(f2 interval 130 month) >'1999-12-01 01:01:01';
24 echo select * from t1 where timestamp_sub(f2 interval 130 month)!='1999-12-01 01:01:01';
25 select * from t1 where timestamp_sub(f2 interval 130 month)!='1999-12-01 01:01:01';