Answer the question
In order to leave comments, you need to log in
How to display entries by day with matching values?
Hello. I have a table {id, idUsr, name, time}. Users appear every day. I need to find records that are duplicated, that is, when two records of the same user are in one day ( by idUsr ). I sent a request like this, but it will display only for the current day, but how can I do it for a month?
SELECT id, idUsr, name, time FROM users WHERE DATE(time) = '2016-08-01' GROUP BY idUsr HAVING COUNT(*) > 1;
Answer the question
In order to leave comments, you need to log in
SELECT id, idUsr, name, time FROM users WHERE DATE(time) BETWEEN '2016-08-01' AND '2016-08-31' GROUP BY idUsr HAVING COUNT(*) > 1
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question