Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
This query is marked as a draft
This query has been published
by
Jtmorgan
.
step 1: join the th2 table with the user table.
Toggle Highlighting
SQL
#select user_id, invite_date, bucket from u2041__thr_p.th2_experimental_user limit 10; /* select AVG(invite_interval) as average_invite_interval FROM ( SELECT user_id, TIMESTAMPDIFF( HOUR, DATE_FORMAT(user_registration,"%Y%m%d%H%i%S"), DATE_FORMAT(invite_date, "%Y%m%d%H%i%S") ) AS invite_interval, bucket FROM u2041__thr_p.th2_experimental_user AS th2 LEFT JOIN enwiki_p.user AS u USING (user_id) ) AS tmp; */ SELECT invite_interval, COUNT(*) AS most_common_invite_interval FROM ( SELECT user_id, TIMESTAMPDIFF( HOUR, DATE_FORMAT(user_registration,"%Y%m%d%H%i%S"), DATE_FORMAT(invite_date, "%Y%m%d%H%i%S") ) AS invite_interval, bucket FROM u2041__thr_p.th2_experimental_user AS th2 LEFT JOIN enwiki_p.user AS u USING (user_id) ) AS tmp GROUP BY invite_interval ORDER BY most_common_invite_interval DESC LIMIT 1;
By running queries you agree to the
Cloud Services Terms of Use
and you irrevocably agree to release your SQL under
CC0 License
.
Submit Query
Stop Query
All SQL code is licensed under
CC0 License
.
Checking query status...