Revision [1661]

Last edited on 2010-10-16 00:07:05 by KlenwellAdmin
Additions:
{{redirect page="ProjectLastGoogle"}}
Deletions:
=====Last Google SQL Library=====
Queries at the lastgoogle site are logged in a mysql database. These are some of the queries I use with that database.

===Top Domains===
SELECT statement to tally top result domains for queries in a given period
%%(sql)
-- Lastgeist: Top Domains for Defined Period (v.2)
-- WHERE clause: change date values to define period
-- LIMIT clause: number in countdown
-- FROM clause: check table name

SELECT
REPLACE(SUBSTRING_INDEX( SUBSTRING_INDEX( result_link, '://', -1 ) , '/', 1 ), 'www.', '') AS result_domain,
count( REPLACE(SUBSTRING_INDEX( SUBSTRING_INDEX( result_link, '://', -1 ) , '/', 1 ), 'www.', '') ) AS result_count
FROM queries
WHERE query <> '' AND result_link REGEXP 'http[s]?://.*'
AND timestamp >= UNIX_TIMESTAMP('2007-01-01')
AND timestamp < UNIX_TIMESTAMP('2007-02-01')
GROUP BY result_domain
ORDER BY result_count DESC
LIMIT 30
%%

----
CategoryLastGoogle


Revision [667]

The oldest known version of this page was created on 2007-07-07 21:28:45 by KlenwellAdmin
Valid XHTML 1.0 TransitionalValid CSSWikkaWiki