1 echo Create table t1
(f1
date, f2
date);
3 Statement Executed
: Rows Affected
= 1
4 Statement Executed
: Rows Affected
= 1
5 Statement Executed
: Rows Affected
= 1
6 Statement Executed
: Rows Affected
= 1
7 Statement Executed
: Rows Affected
= 1
9 ---------------------------------------------------------
11 ---------------------------------------------------------
18 echo select * from t1 where date_sub
(f2 interval
2 day
) = '2012-02-28';
19 ---------------------------------------------------------
21 ---------------------------------------------------------
24 echo select * from t1 where date_sub
(f2 interval
15 day
) <= '2012-02-28';
25 ---------------------------------------------------------
27 ---------------------------------------------------------
32 echo select * from t1 where date_sub
(f2 interval
15 day
) >= '2012-02-15';
33 ---------------------------------------------------------
35 ---------------------------------------------------------
40 echo select * from t1 where date_sub
(f2 interval
40 day
) <= '2012-01-21';
41 ---------------------------------------------------------
43 ---------------------------------------------------------
48 echo select * from t1 where date_sub
(f2 interval
40 day
) != '2012-01-21';
49 ---------------------------------------------------------
51 ---------------------------------------------------------
57 echo select * from t1 where date_sub
(f2 interval
365 day
) <= '2011-03-02';
58 ---------------------------------------------------------
60 ---------------------------------------------------------
65 echo select * from t1 where date_sub
(f2 interval
366 day
) >= '2011-03-02';
66 ---------------------------------------------------------
68 ---------------------------------------------------------
72 echo select * from t1 where date_sub
(f2 interval
366 day
) != '2011-03-02';
73 ---------------------------------------------------------
75 ---------------------------------------------------------