--
-- ### Check advanced aggregation
--
drop if exists table t1;
drop if exists table t2;
create table t1 ( a datetime );
create table t2 ( a int, b int, c int );

insert into t1 values ( sysdate );
select sum( date2int(a) )  from t1;

insert into t2 values ( 1, 2, 3 );
insert into t2 values ( 100, 20, 77 );

select sum(a) + sum(b) + sum(c), sum(a) - sum(b), avg(a), avg(b) from t2;
select count(a) + sum(b), avg(a) - sum(b) - sum(a) from t2;


