How convert continuous queries?

Hello!
I can’t figure out how to rewrite the query.
There are two questions:

  1. how to group by all tags (*)
  2. how to apply multiple functions

CREATE CONTINUOUS QUERY cq_history ON paet RESAMPLE FOR 4h BEGIN SELECT min(value), max(value), count(value), mean(value), sum(value) INTO paet.history.transactions_history FROM paet.“default”.transactions GROUP BY time(1h), * END