Answer the question
In order to leave comments, you need to log in
How to select repetitions by SQL query?
Table with data of site visitors. You need to find out if there are ips that are repeated every day, for example 100.100.100.15
Answer the question
In order to leave comments, you need to log in
SELECT ip
FROM
(
SELECT ip, date
FROM table
GROUP BY ip, date
) AS t1
GROUP BY ip
HAVING COUNT(ip) = (SELECT COUNT(date) FROM table GROUP BY date)
SELECT ip
FROM
(
SELECT ip, date
FROM table
GROUP BY ip, date
) AS t1
GROUP BY ip
HAVING COUNT(ip) > 1
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question