1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| SELECT p.id, p.domain, s1.traffic AS traffic, c.country as maincountry
FROM dt_parked p
inner join
(select sum(s1.uniques) as traffic, owner,domain
where uniques>0 and date >= DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY)
group by domain,owner) s1
on s1.domain=p.domain and s1.owner=p.owner
inner join
(SELECT country, domain, SUM(uniques) as somme
FROM ".TABLE_PREFIX."cached_countries
where LOWER(country)!='x1'
group by country, domain
order by somme desc) c
on c.domain=p.domain
WHERE p.blocked='3'
ORDER BY traffic DESC
LIMIT 1500; |
Partager