SELECT MacValue, GROUP_CONCAT(VisitTime), COUNT(*)
FROM (
SELECT DISTINCT MacValue, DATE(FROM_UNIXTIME(VisitTime))
FROM bigbrother.00540
WHERE VisitTime BETWEEN UNIX_TIMESTAMP('2019-12-01 00:00:00') AND UNIX_TIMESTAMP('2020-03-01 23:59:59')
GROUP BY FROM_UNIXTIME( TRUNCATE( VisitTime / 1200, 0 ) * 1200 ) , macvalue
HAVING COUNT(MacValue) >= 3
)
SELECT DISTINCT MacValue, date(FROM_UNIXTIME(visittime)) в этой строчке выдает ошибку #1054 - Неизвестный столбец 'VisitTime' в 'field list'