Get Uniqie views and views in one SQL query
-
07-02-2021 - |
Вопрос
I would like to retrive uniqie views and views in a single query. My current query to retrive views looks like this, but i would also like to retrieve unique views with it.
The field to the IP address is called IP
SELECT `time` - `time` % 86400 AS Date, count(*) AS Views
FROM `bvcms_pageviews`
WHERE 1=1
GROUP BY Date
Best regards
Решение
Unique IP view data? Selected 'Distinct' would help with this
SELECT DISTINCT IP, `time` - `time` % 86400 AS Date, count(IP) AS
Views FROM `bvcms_pageviews` WHERE 1=1 GROUP BY Date
Не связан с StackOverflow