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
ԱշոտՏՆՂ
.
Toggle Highlighting
SQL
CREATE FUNCTION GetLogTypeCount(log_type_val VARCHAR(255), user_id_val INT) RETURNS INT BEGIN DECLARE log_type_count INT; SELECT COUNT(*) INTO log_type_count FROM logging JOIN actor ON actor_id = log_actor WHERE log_type = log_type_val AND actor_user = user_id_val; RETURN log_type_count; END; SELECT user_name, (SELECT count(*) FROM logging JOIN actor ON actor_id = log_actor WHERE log_type = 'abusefilter' AND actor_user = user_id) abusefilter_count, (SELECT count(*) FROM logging JOIN actor ON actor_id = log_actor WHERE log_action = 'block' AND actor_user = user_id) block_count, (SELECT count(*) FROM logging JOIN actor ON actor_id = log_actor WHERE log_action = 'unblock' AND actor_user = user_id) unblock_count, (SELECT count(*) FROM logging JOIN actor ON actor_id = log_actor WHERE log_action = 'reblock' AND actor_user = user_id) reblock_count, (SELECT count(*) FROM logging JOIN actor ON actor_id = log_actor WHERE log_type in ('contentmodel') AND actor_user = user_id) contentmodel_count FROM user JOIN user_groups ON user_id = ug_user WHERE ug_group = 'sysop'; #SELECT DISTINCT log_action #FROM hywiki_p.logging
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...