Skip to content

Instantly share code, notes, and snippets.

@halfak
Created October 31, 2014 00:29
Show Gist options
  • Save halfak/0dfc0ff8beb93b84f73b to your computer and use it in GitHub Desktop.
Save halfak/0dfc0ff8beb93b84f73b to your computer and use it in GitHub Desktop.
CREATE TABLE halfak.searches
SELECT dt, ip, user_agent, uri_host, uri_query
FROM webrequest
WHERE
uri_query LIKE "%title=Special%3ASearch%" AND
uri_query LIKE "%search=%" AND
uri_path = "/w/index.php" AND
year = 2014;
@Ironholds
Copy link

Suggest tweak to:
CREATE TABLE halfak.searches
SELECT dt, ip, user_agent, accept_language, uri_host, uri_query
FROM webrequest
WHERE
uri_query LIKE "%search=%" AND
uri_path = "/w/index.php" AND
year = 2014 AND
month = 10 AND
day BETWEEN 01 AND 30 AND
webrequest_source = 'text' AND
http_status = '200';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment