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_diff
(f2
,f1
)=2;
19 ---------------------------------------------------------
21 ---------------------------------------------------------
24 echo select * from t1 where date_diff
(f1
,f2
)=2;
25 ---------------------------------------------------------
27 ---------------------------------------------------------
29 echo select * from t1 where date_diff
(f2
,f1
)=31;
30 ---------------------------------------------------------
32 ---------------------------------------------------------
35 echo select * from t1 where date_diff
(f2
,f1
)=59;
36 ---------------------------------------------------------
38 ---------------------------------------------------------
41 echo select * from t1 where date_diff
(f2
,f1
)=365;
42 ---------------------------------------------------------
44 ---------------------------------------------------------
47 echo select * from t1 where date_diff
(f2
,f1
)=397;
48 ---------------------------------------------------------
50 ---------------------------------------------------------
53 echo select * from t1 where date_diff
(f2
,f1
)<59;
54 ---------------------------------------------------------
56 ---------------------------------------------------------
60 echo select * from t1 where date_diff
(f2
,f1
)<=59;
61 ---------------------------------------------------------
63 ---------------------------------------------------------
68 echo select * from t1 where date_diff
(f2
,f1
)>59;
69 ---------------------------------------------------------
71 ---------------------------------------------------------
75 echo select * from t1 where date_diff
(f2
,f1
)>=59;
76 ---------------------------------------------------------
78 ---------------------------------------------------------
83 echo select * from t1 where date_diff
(f2
,f1
)!=59;
84 ---------------------------------------------------------
86 ---------------------------------------------------------
92 echo select * from t1 where date_diff
(f2
,'2001-01-01')=2;
93 ---------------------------------------------------------
95 ---------------------------------------------------------
98 echo select * from t1 where date_diff
(f2
,'2001-01-01')>=59;
99 ---------------------------------------------------------
101 ---------------------------------------------------------
106 echo select * from t1 where date_diff
(f2
,'2001-01-01')!=365;
107 ---------------------------------------------------------
109 ---------------------------------------------------------
115 echo select * from t1 where datediff
('2001-01-02','2001-01-01')=1;
116 ---------------------------------------------------------
118 ---------------------------------------------------------