select (intDiv(toUInt32(ts), 10) * 10) * 1000 as t, count(mac) as MACs from noc.mac where managed_object = 7065706933363928403 and interface = ('GigabitEthernet0/0/17') and dateDiff('hour', toDateTime('2021-03-03 00:00:00'), toDateTime('2021-03-05 00:00:00')) GROUP BY t ORDER BY t