adding test scripts
[csql.git] / test / sql / ScalarFunction / exp.test002.ksh
blobaae25ea77d6ea4d94c4e331c66054df281190ba7
1 echo Create table t1(f1 time, f2 time);
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 1:1:1.0 1:1:3.0
13 1:1:1.0 1:2:1.0
14 1:1:1.0 1:3:1.0
15 1:1:1.0 2:1:1.0
16 1:1:1.0 2:2:2.0
18 echo select * from t1 where time_diff(f2,f1)=2;
19 ---------------------------------------------------------
20 t1.f1 t1.f2
21 ---------------------------------------------------------
22 1:1:1.0 1:1:3.0
24 echo select * from t1 where time_diff(f1,f2)=2;
25 ---------------------------------------------------------
26 t1.f1 t1.f2
27 ---------------------------------------------------------
29 echo select * from t1 where time_diff(f2,f1)=60;
30 ---------------------------------------------------------
31 t1.f1 t1.f2
32 ---------------------------------------------------------
33 1:1:1.0 1:2:1.0
35 echo select * from t1 where time_diff(f2,f1)=120;
36 ---------------------------------------------------------
37 t1.f1 t1.f2
38 ---------------------------------------------------------
39 1:1:1.0 1:3:1.0
41 echo select * from t1 where time_diff(f2,f1)=3600;
42 ---------------------------------------------------------
43 t1.f1 t1.f2
44 ---------------------------------------------------------
45 1:1:1.0 2:1:1.0
47 echo select * from t1 where time_diff(f2,f1)=3661;
48 ---------------------------------------------------------
49 t1.f1 t1.f2
50 ---------------------------------------------------------
51 1:1:1.0 2:2:2.0
53 echo select * from t1 where time_diff(f2,f1)<120;
54 ---------------------------------------------------------
55 t1.f1 t1.f2
56 ---------------------------------------------------------
57 1:1:1.0 1:1:3.0
58 1:1:1.0 1:2:1.0
60 echo select * from t1 where time_diff(f2,f1)<=120;
61 ---------------------------------------------------------
62 t1.f1 t1.f2
63 ---------------------------------------------------------
64 1:1:1.0 1:1:3.0
65 1:1:1.0 1:2:1.0
66 1:1:1.0 1:3:1.0
68 echo select * from t1 where time_diff(f2,f1)>120;
69 ---------------------------------------------------------
70 t1.f1 t1.f2
71 ---------------------------------------------------------
72 1:1:1.0 2:1:1.0
73 1:1:1.0 2:2:2.0
75 echo select * from t1 where time_diff(f2,f1)>=120;
76 ---------------------------------------------------------
77 t1.f1 t1.f2
78 ---------------------------------------------------------
79 1:1:1.0 1:3:1.0
80 1:1:1.0 2:1:1.0
81 1:1:1.0 2:2:2.0
83 echo select * from t1 where time_diff(f2,f1)!=120;
84 ---------------------------------------------------------
85 t1.f1 t1.f2
86 ---------------------------------------------------------
87 1:1:1.0 1:1:3.0
88 1:1:1.0 1:2:1.0
89 1:1:1.0 2:1:1.0
90 1:1:1.0 2:2:2.0
92 echo select * from t1 where time_diff(f2,'01:01:01')=2;
93 ---------------------------------------------------------
94 t1.f1 t1.f2
95 ---------------------------------------------------------
96 1:1:1.0 1:1:3.0
98 echo select * from t1 where time_diff(f2,'01:01:01')>=120;
99 ---------------------------------------------------------
100 t1.f1 t1.f2
101 ---------------------------------------------------------
102 1:1:1.0 1:3:1.0
103 1:1:1.0 2:1:1.0
104 1:1:1.0 2:2:2.0
106 echo select * from t1 where time_diff(f2,'01:01:01')!=3600;
107 ---------------------------------------------------------
108 t1.f1 t1.f2
109 ---------------------------------------------------------
110 1:1:1.0 1:1:3.0
111 1:1:1.0 1:2:1.0
112 1:1:1.0 1:3:1.0
113 1:1:1.0 2:2:2.0
115 echo select * from t1 where time_diff('01:01:02','01:01:01')=1;
116 ---------------------------------------------------------
117 t1.f1 t1.f2
118 ---------------------------------------------------------
119 1:1:1.0 1:1:3.0
120 1:1:1.0 1:2:1.0
121 1:1:1.0 1:3:1.0
122 1:1:1.0 2:1:1.0
123 1:1:1.0 2:2:2.0
125 Statement Executed