|
|
used term for function like binding parameter for SQL. Exactly, create the view as described using cross join/where/group and then return the requested month sum,
select c1, ..., sum_val from grouped_view whre my_month='202107' ;
--create month dimension table or view with (col my_month, start, end)
--create grouped_view as select t1.c1, ..., t2.my_month, sum(t1.val) sum_val from t1, dim_month t2 where t1.month between t2.start and t2.end group by t1.c1, ..., t2.my_month ;
|
|