def export_intervals(query, date_entity, interval, fmt): return nest_count_keys(count_groups(query, func.to_char(func.date_trunc(interval, date_entity), fmt)))
def export_intervals(query, date_entity, interval, fmt): return nest_count_keys( count_groups(query, func.to_char(func.date_trunc(interval, date_entity), fmt)))