core reorg
[csql.git] / test / sql / ScalarFunction / exp.test008.ksh
blobd32e11bdccaccb4f1fbd06163ba181118713c0fd
1 echo Create table t1(f1 date, f2 date);
2 Statement Executed
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
8 echo select * from t1;
9 ---------------------------------------------------------
10 t1.f1 t1.f2
11 ---------------------------------------------------------
12 2008/1/20 2010/1/1
13 2009/4/20 2011/2/1
14 2010/2/27 2012/3/1
15 2011/2/28 2013/3/1
16 2012/2/29 2014/1/1
18 echo select * from t1 where date_sub(f2 interval 2 day) = '2012-02-28';
19 ---------------------------------------------------------
20 t1.f1 t1.f2
21 ---------------------------------------------------------
22 2010/2/27 2012/3/1
24 echo select * from t1 where date_sub(f2 interval 15 day) <= '2012-02-28';
25 ---------------------------------------------------------
26 t1.f1 t1.f2
27 ---------------------------------------------------------
28 2008/1/20 2010/1/1
29 2009/4/20 2011/2/1
30 2010/2/27 2012/3/1
32 echo select * from t1 where date_sub(f2 interval 15 day) >= '2012-02-15';
33 ---------------------------------------------------------
34 t1.f1 t1.f2
35 ---------------------------------------------------------
36 2010/2/27 2012/3/1
37 2011/2/28 2013/3/1
38 2012/2/29 2014/1/1
40 echo select * from t1 where date_sub(f2 interval 40 day) <= '2012-01-21';
41 ---------------------------------------------------------
42 t1.f1 t1.f2
43 ---------------------------------------------------------
44 2008/1/20 2010/1/1
45 2009/4/20 2011/2/1
46 2010/2/27 2012/3/1
48 echo select * from t1 where date_sub(f2 interval 40 day) != '2012-01-21';
49 ---------------------------------------------------------
50 t1.f1 t1.f2
51 ---------------------------------------------------------
52 2008/1/20 2010/1/1
53 2009/4/20 2011/2/1
54 2011/2/28 2013/3/1
55 2012/2/29 2014/1/1
57 echo select * from t1 where date_sub(f2 interval 365 day) <= '2011-03-02';
58 ---------------------------------------------------------
59 t1.f1 t1.f2
60 ---------------------------------------------------------
61 2008/1/20 2010/1/1
62 2009/4/20 2011/2/1
63 2010/2/27 2012/3/1
65 echo select * from t1 where date_sub(f2 interval 366 day) >= '2011-03-02';
66 ---------------------------------------------------------
67 t1.f1 t1.f2
68 ---------------------------------------------------------
69 2011/2/28 2013/3/1
70 2012/2/29 2014/1/1
72 echo select * from t1 where date_sub(f2 interval 366 day) != '2011-03-02';
73 ---------------------------------------------------------
74 t1.f1 t1.f2
75 ---------------------------------------------------------
76 2008/1/20 2010/1/1
77 2009/4/20 2011/2/1
78 2010/2/27 2012/3/1
79 2011/2/28 2013/3/1
80 2012/2/29 2014/1/1
82 Statement Executed