Skip to content

Instantly share code, notes, and snippets.

@pustynnykh
Created November 8, 2016 10:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pustynnykh/9bd6e93a27485860f2e6f6c5d247b96f to your computer and use it in GitHub Desktop.
Save pustynnykh/9bd6e93a27485860f2e6f6c5d247b96f to your computer and use it in GitHub Desktop.
Unique users login count per day in specified period using login_history database table in Drupal 7
SELECT FROM_UNIXTIME(login, '%Y/%m/%d') AS dates, count(distinct(uid)) as theCount
FROM login_history
WHERE login BETWEEN 1478476800 AND 1478645999
GROUP BY dates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment