Aggregation of old data with QUERY INTO clause

Hey,

I have the following measurement in my influxdb:

time               duration        responseCode          type
----               --------        ------------ -        ---
1542534671000000000   147             200              response
1542534673000000000   37              200              response
1542534675000000000   48              200              response
1542534677000000000   37              200              response

I want to aggregate these data by one minute and store them into different retention politic by using the following query:

select mean("duration") AS "duration", mean("responseCode") AS "responseCode", mean("type") AS "type" INTO aggregated."aggregateddata" FROM autogen."data" group by time(1m)


> select * from aggregated3."mmr.fmc" limit 10
name: mmr.fmc
time                duration          responseCode type
----                --------          ------------ ----
1542534660000000000 48                200          
1542534720000000000 53                200          
1542534780000000000 41.03448275862069 200          
1542534840000000000 44.8              200          
1542534900000000000 45.3448275862069  200          
1542534960000000000 45.93103448275862 200          
1542535020000000000 46.55172413793103 200          
1542535080000000000 43.46666666666667 200          
1542535140000000000 49.10344827586207 200          
1542535200000000000 65.03333333333333 200 

as you can see there is no values in type field. Is there any solution? I tried to use mean function only for duration field but then I cannot use field without function in the query. It gives the error : “mixing aggregate and non-aggregate queries is not supported”.

Hope there is some option for passing it.

Thanks for reply!