Вопрос

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

http://www.sql-tutorial.com/sql-distinct-sql-tutorial/

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top