I have a database that contains multiple url
and a date (created_at
) associate with each of these url
.
I would like to have something like:
Select DISTINCT url, "the first date of this url"
from database
where blabala
My problem is when a add the date to the select I get this:
/url/sdfsd | 2014-07-19
/url/sdfsd | 2014-07-20
/url/sdfsd | 2014-07-25
And what I want is only:
/url/sdfsd | 2014-07-19
I realise that i over simplified my problem but thanks to you guys i managed to find a solution
select req2.date, COUNT(DATE(req2.date)) as count
from (
select hash_request -> 'PATH_INFO', min(DATE(created_at)) as date
from (
select *
from request_statistics
where LOWER(hash_request -> 'HTTP_USER_AGENT') LIKE '%google%'
) req1
group by hash_request -> 'PATH_INFO'
) req2
group by req2.date
order by req2.date asc
i had difficulty grouping the date on all the unique url. now i have, for each day what is the amount of unique url of all the unique url