Skip to content

Instantly share code, notes, and snippets.

@skyred
Last active December 16, 2015 19:59
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 skyred/5488714 to your computer and use it in GitHub Desktop.
Save skyred/5488714 to your computer and use it in GitHub Desktop.
Drupal.org Chinese user statistics
// The number of users from China by the end of 2010
SELECT count(users.uid) AS uid
FROM users users
LEFT JOIN profile_values profile_values_profile_country ON users.uid = profile_values_profile_country.uid AND profile_values_profile_country.fid = '1'
WHERE (profile_values_profile_country.value in ('China')) AND (users.created <= 1293836399)
// The number of users from China by the end of 2011
SELECT count(users.uid) AS uid
FROM users users
LEFT JOIN profile_values profile_values_profile_country ON users.uid = profile_values_profile_country.uid AND profile_values_profile_country.fid = '1'
WHERE (profile_values_profile_country.value in ('China')) AND (users.created <= 1325372399)
// The number of users from China by the end of 2012
SELECT count(users.uid) AS uid
FROM users users
LEFT JOIN profile_values profile_values_profile_country ON users.uid = profile_values_profile_country.uid AND profile_values_profile_country.fid = '1'
WHERE (profile_values_profile_country.value in ('China')) AND (users.created <= 1356994799)
// The number of users speaking Simplified or Traditional Chinese by the end of 2010
SELECT count(users.uid) AS uid
FROM users users
LEFT JOIN profile_values profile_values_profile_language ON users.uid = profile_values_profile_language.uid AND profile_values_profile_language.fid = '3'
WHERE (users.created <= 1293836399) AND (profile_values_profile_language.value in ('Chinese, Simplified', 'Chinese, Traditional'))
// The number of users speaking Simplified or Traditional Chinese by the end of 2011
SELECT count(users.uid) AS uid
FROM users users
LEFT JOIN profile_values profile_values_profile_language ON users.uid = profile_values_profile_language.uid AND profile_values_profile_language.fid = '3'
WHERE (users.created <= 1325372399) AND (profile_values_profile_language.value in ('Chinese, Simplified', 'Chinese, Traditional'))
// The number of users speaking Simplified or Traditional Chinese by the end of 2012
SELECT count(users.uid) AS uid
FROM users users
LEFT JOIN profile_values profile_values_profile_language ON users.uid = profile_values_profile_language.uid AND profile_values_profile_language.fid = '3'
WHERE (users.created <= 1356994799) AND (profile_values_profile_language.value in ('Chinese, Simplified', 'Chinese, Traditional'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment