--
-- ### Between condition checks
--

create table t1 ( primary a int not null, b datetime);
create index t1_idx1 on t1 ( b );

insert into t1 values ( 1, date('%d%m%Y %H%M%S', '01012010 120000'));
insert into t1 values ( 10, date('%d%m%Y %H%M%S', '01022010 120000'));
insert into t1 values ( 15, date('%d%m%Y %H%M%S', '01032010 120000'));
insert into t1 values ( 16, date('%d%m%Y %H%M%S', '01042010 120000'));
insert into t1 values ( 17, date('%d%m%Y %H%M%S', '01052010 120000'));
insert into t1 values ( 20, date('%d%m%Y %H%M%S', '01062010 120000'));
insert into t1 values ( 30, date('%d%m%Y %H%M%S', '01082010 120000'));

create view tv as select b as b from t1;

select * from tv;
select * from tv where b between date('%d%m%Y %H%M%S', '01022010 120000') and date('%d%m%Y %H%M%S', '01032010 120000');

select * from t1 where a < 10;
select * from t1 where a between 10 and 20;

drop view tv;
drop table t1; 