select date_trunc('hour',timestamp) as hour, action_type, user_type as user_type,
count(1) as action_count,
sum(amount) as action_volume
from account_activity where timestamp >= '{{start_time}}' -- You can insert parameters from the CLI with the "-X key=value"
and timestamp < '{{end_time}}'  
group by hour, action_type, user_type
order by hour                           -- Sort the output on timestamp
