adding test scripts
[csql.git] / test / sql / ScalarFunction / time_diff.sql
blob0426f1b1a7d97c83b9227900b1ee4a781620fce4
1 echo Create table t1(f1 time, f2 time);
2 Create table t1(f1 time, f2 time);
3 insert into t1 values('01:01:01', '01:01:03');
4 insert into t1 values('01:01:01', '01:02:01');
5 insert into t1 values('01:01:01', '01:03:01');
6 insert into t1 values('01:01:01', '02:01:01');
7 insert into t1 values('01:01:01', '02:02:02');
8 echo select * from t1;
9 select * from t1;
10 echo select * from t1 where time_diff(f2,f1)=2;
11 select * from t1 where time_diff(f2,f1)=2;
12 echo select * from t1 where time_diff(f1,f2)=2;
13 select * from t1 where time_diff(f1,f2)=2;
14 echo select * from t1 where time_diff(f2,f1)=60;
15 select * from t1 where time_diff(f2,f1)=60;
16 echo select * from t1 where time_diff(f2,f1)=120;
17 select * from t1 where time_diff(f2,f1)=120;
18 echo select * from t1 where time_diff(f2,f1)=3600;
19 select * from t1 where time_diff(f2,f1)=3600;
20 echo select * from t1 where time_diff(f2,f1)=3661;
21 select * from t1 where time_diff(f2,f1)=3661;
22 echo select * from t1 where time_diff(f2,f1)<120;
23 select * from t1 where time_diff(f2,f1)<120;
24 echo select * from t1 where time_diff(f2,f1)<=120;
25 select * from t1 where time_diff(f2,f1)<=120;
26 echo select * from t1 where time_diff(f2,f1)>120;
27 select * from t1 where time_diff(f2,f1)>120;
28 echo select * from t1 where time_diff(f2,f1)>=120;
29 select * from t1 where time_diff(f2,f1)>=120;
30 echo select * from t1 where time_diff(f2,f1)!=120;
31 select * from t1 where time_diff(f2,f1)!=120;
32 echo select * from t1 where time_diff(f2,'01:01:01')=2;
33 select * from t1 where time_diff(f2,'01:01:01')=2;
34 echo select * from t1 where time_diff(f2,'01:01:01')>=120;
35 select * from t1 where time_diff(f2,'01:01:01')>=120;
36 echo select * from t1 where time_diff(f2,'01:01:01')!=3600;
37 select * from t1 where time_diff(f2,'01:01:01')!=3600;
38 echo select * from t1 where time_diff('01:01:02','01:01:01')=1;
39 select * from t1 where time_diff('01:01:02','01:01:01')=1;