adding test scripts
[csql.git] / test / sql / ScalarFunction / extract_hourminutesecond_from_timestamp.sql
blob8ab0acf5ddf59ed529c914bba694ad69d06d9080
1 echo Create table t1(f1 timestamp, f2 timestamp);
2 Create table t1(f1 timestamp, f2 timestamp);
3 insert into t1 values('2001-01-01 01:01:01', '2001-01-05 01:01:01');
4 insert into t1 values('2002-01-01 01:01:01', '2002-04-10 02:02:02');
5 insert into t1 values('2003-01-03 01:01:01', '2003-07-15 12:30:30');
6 insert into t1 values('2004-01-01 01:01:01', '2004-10-20 22:58:58');
7 insert into t1 values('2005-01-01 01:01:01', '2005-12-25 23:59:59');
8 echo select * from t1;
9 select * from t1;
10 echo select * from t1 where extract(hour from f2) =12;
11 select * from t1 where extract(hour from f2) =12;
12 echo select * from t1 where extract(hour from f2)<=12;
13 select * from t1 where extract(hour from f2)<=12;
14 echo select * from t1 where extract(hour from f2) >12;
15 select * from t1 where extract(hour from f2) >12;
16 echo select * from t1 where extract(hour from f2)!=12;
17 select * from t1 where extract(hour from f2)!=12;
18 echo select * from t1 where extract(minute from f2) =30;
19 select * from t1 where extract(minute from f2) =30;
20 echo select * from t1 where extract(minute from f2) <30;
21 select * from t1 where extract(minute from f2) <30;
22 echo select * from t1 where extract(minute from f2)>=30;
23 select * from t1 where extract(minute from f2)>=30;
24 echo select * from t1 where extract(minute from f2)!=30;
25 select * from t1 where extract(minute from f2)!=30;
26 echo select * from t1 where extract(second from f2) =30;
27 select * from t1 where extract(second from f2) =30;
28 echo select * from t1 where extract(second from f2) <30;
29 select * from t1 where extract(second from f2) <30;
30 echo select * from t1 where extract(second from f2) >30;
31 select * from t1 where extract(second from f2) >30;
32 echo select * from t1 where extract(second from f2)<>30;
33 select * from t1 where extract(second from f2)<>30;