adding test scripts
[csql.git] / test / sql / ScalarFunction / exp.test024.ksh
blobe940abaea0308d4faae1442a0c8e4cfa5f247c9d
1 echo Create table t1(f1 timestamp, f2 timestamp);
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 2001/1/1 1:1:1.0 2001/5/5 5:1:1.0
13 2002/1/1 1:1:1.0 2002/3/5 5:1:1.0
14 2003/1/1 1:1:1.0 2003/3/5 5:1:1.0
15 2004/1/1 1:1:1.0 2004/3/5 5:1:1.0
16 2005/1/1 1:1:1.0 2005/1/5 5:1:1.0
18 echo select * from t1 where timestamp_sub(f2 interval 4 hour) ='2003-03-05 01:01:01';
19 ---------------------------------------------------------
20 t1.f1 t1.f2
21 ---------------------------------------------------------
22 2003/1/1 1:1:1.0 2003/3/5 5:1:1.0
24 echo select * from t1 where timestamp_sub(f2 interval 4 hour)<='2003-03-05 01:01:01';
25 ---------------------------------------------------------
26 t1.f1 t1.f2
27 ---------------------------------------------------------
28 2001/1/1 1:1:1.0 2001/5/5 5:1:1.0
29 2002/1/1 1:1:1.0 2002/3/5 5:1:1.0
30 2003/1/1 1:1:1.0 2003/3/5 5:1:1.0
32 echo select * from t1 where timestamp_sub(f2 interval 4 hour) >'2003-03-05 01:01:01';
33 ---------------------------------------------------------
34 t1.f1 t1.f2
35 ---------------------------------------------------------
36 2004/1/1 1:1:1.0 2004/3/5 5:1:1.0
37 2005/1/1 1:1:1.0 2005/1/5 5:1:1.0
39 echo select * from t1 where timestamp_sub(f2 interval 244 hour) ='2001-04-25 01:01:01';
40 ---------------------------------------------------------
41 t1.f1 t1.f2
42 ---------------------------------------------------------
43 2001/1/1 1:1:1.0 2001/5/5 5:1:1.0
45 echo select * from t1 where timestamp_sub(f2 interval 244 hour)>='2001-04-25 01:01:01';
46 ---------------------------------------------------------
47 t1.f1 t1.f2
48 ---------------------------------------------------------
49 2001/1/1 1:1:1.0 2001/5/5 5:1:1.0
50 2002/1/1 1:1:1.0 2002/3/5 5:1:1.0
51 2003/1/1 1:1:1.0 2003/3/5 5:1:1.0
52 2004/1/1 1:1:1.0 2004/3/5 5:1:1.0
53 2005/1/1 1:1:1.0 2005/1/5 5:1:1.0
55 echo select * from t1 where timestamp_sub(f2 interval 244 hour) ='2002-02-23 01:01:01';
56 ---------------------------------------------------------
57 t1.f1 t1.f2
58 ---------------------------------------------------------
59 2002/1/1 1:1:1.0 2002/3/5 5:1:1.0
61 echo select * from t1 where timestamp_sub(f2 interval 244 hour)<='2002-02-23 01:01:01';
62 ---------------------------------------------------------
63 t1.f1 t1.f2
64 ---------------------------------------------------------
65 2001/1/1 1:1:1.0 2001/5/5 5:1:1.0
66 2002/1/1 1:1:1.0 2002/3/5 5:1:1.0
68 echo select * from t1 where timestamp_sub(f2 interval 244 hour) ='2004-02-24 01:01:01';
69 ---------------------------------------------------------
70 t1.f1 t1.f2
71 ---------------------------------------------------------
72 2004/1/1 1:1:1.0 2004/3/5 5:1:1.0
74 echo select * from t1 where timestamp_sub(f2 interval 244 hour)>='2004-02-24 01:01:01';
75 ---------------------------------------------------------
76 t1.f1 t1.f2
77 ---------------------------------------------------------
78 2004/1/1 1:1:1.0 2004/3/5 5:1:1.0
79 2005/1/1 1:1:1.0 2005/1/5 5:1:1.0
81 echo select * from t1 where timestamp_sub(f2 interval 960 hour) ='2004-11-26 05:01:01';
82 ---------------------------------------------------------
83 t1.f1 t1.f2
84 ---------------------------------------------------------
85 2005/1/1 1:1:1.0 2005/1/5 5:1:1.0
87 echo select * from t1 where timestamp_sub(f2 interval 960 hour)!='2004-11-26 05:01:01';
88 ---------------------------------------------------------
89 t1.f1 t1.f2
90 ---------------------------------------------------------
91 2001/1/1 1:1:1.0 2001/5/5 5:1:1.0
92 2002/1/1 1:1:1.0 2002/3/5 5:1:1.0
93 2003/1/1 1:1:1.0 2003/3/5 5:1:1.0
94 2004/1/1 1:1:1.0 2004/3/5 5:1:1.0
96 Statement Executed