Answer the question
In order to leave comments, you need to log in
How to set up a selection of addresses for every hour?
TK: find unique poppy addresses in the database, from June 1 to June 12, which met more than 10 times. Code example: SELECT macvalue
FROM bigbrother.00100
WHERE DATE_FORMAT(FROM_UNIXTIME(VisitTime), '%Y-%m-%d %H:00:00') BETWEEN '2019-06-01 0:00:00' AND '2019 -06-12 23:59:59'
GROUP by macvalue
HAVING COUNT(MacValue)>10
This is incorrect because it doesn't count exactly how many times in any particular hour there were more than 10 times the same address.
Question: how to make a selection specifically by hour, for example: (more than 10 times were in the period from 12 to 13, or from 20 to 21 hours) I was told to do this using Round and Truncate, but I don’t know how
Answer the question
In order to leave comments, you need to log in
SELECT macvalue,
count(*) as cnt -- gsom!
FROM bigbrother.00100
WHERE DATE_FORMAT(FROM_UNIXTIME(VisitTime), '%Y-%m-%d %H:00:00') BETWEEN '2019-06-01 0:00:00' AND '2019-06-12 23:59:59'
GROUP by macvalue
HAVING COUNT(MacValue)>10
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question