adding test scripts
[csql.git] / test / sql / ScalarFunction / timestamp_diff_month.sql
blob42bc89cee3dc54dbdfa0bda8161d0e4528985456
1 Create table t1(f1 timestamp, f2 timestamp);
2 insert into t1 values('2002-01-01 01:01:01', '2002-01-01 01:01:01');
3 insert into t1 values('2002-01-01 01:01:01', '2002-02-03 01:01:01');
4 insert into t1 values('2002-01-01 01:01:01', '2002-03-01 01:01:01');
5 insert into t1 values('2002-01-01 01:01:01', '2004-02-01 01:01:01');
6 insert into t1 values('2002-01-10 01:01:01', '2004-02-01 01:01:01');
7 insert into t1 values('2002-01-01 01:01:01', '2004-03-01 01:01:01');
8 insert into t1 values('2002-01-10 01:01:01', '2004-03-01 01:01:01');
9 echo select * from t1;
10 select * from t1;
11 echo select * from t1 where timestamp_diff(month,f1,f2)=0;
12 select * from t1 where timestamp_diff(month,f1,f2)=0;
13 echo select * from t1 where timestamp_diff(month,f2,f1)<=2;
14 select * from t1 where timestamp_diff(month,f2,f1)<=2;
15 echo select * from t1 where timestamp_diff(month,f2,f1)=25;
16 select * from t1 where timestamp_diff(month,f2,f1)=25;
17 echo select * from t1 where timestamp_diff(month,f2,f1)>=25;
18 select * from t1 where timestamp_diff(month,f2,f1)>=25;
19 echo select * from t1 where timestamp_diff(month,f2,f1)=26;
20 select * from t1 where timestamp_diff(month,f2,f1)=26;
21 echo select * from t1 where timestamp_diff(month,f2,f1)!=26;
22 select * from t1 where timestamp_diff(month,f2,f1)!=26;