1

Topic: To statistican of unique visitors, for every day weeks (well or to another the period)

Greetings, here I can not invent as request to construct, can prompt
There is a table with statistics:
visit_id | visit_ip | campaign_name | created_time
[img=http://dl3.joxi.net/drive/2017/12/10/0023/1810/1546002/02/6991e26e34.jpg]
On it I can construct such schedule, how many all visitors for a day
[img=http://dl3.joxi.net/drive/2017/12/10/0023/1810/1546002/02/c3b9612e4c.jpg]
It becomes so

SELECT count (*), created_time FROM leads_visit GROUP BY DAY (created_time)

And here if I have to display unique visitors for a day?
Maximum on what I sufficed it all  to filter on uniqueness and then to break on days

SELECT count (*), uniquec.created_time FROM (SELECT * FROM leads_visit GROUP BY visit_ip) as uniquec GROUP BY DAY (uniquec.created_time)

But it a little bit not that... As a matter of fact I should activate this filter not by all period but only by the day period, type I come every day on a site and I am every day on the schedule more shortly at me 2 variants, to do 30 requests for 30 days, the second it to filter given by means php if who knows the third let know

2

Re: To statistican of unique visitors, for every day weeks (well or to another the period)

bd_kcuf wrote:

and here if I should display unique visitors for a day?

Well judging by that, on what you sufficed - probably, unique addresses, instead of visitors?

SELECT DAY (created_time), COUNT (DISTINCT visit_ip)
FROM leads_visit
GROUP BY DAY (created_time)

3

Re: To statistican of unique visitors, for every day weeks (well or to another the period)

Akina, yes, Many thanks!