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
Msz2001
.
Toggle Highlighting
SQL
-- Daty początku i końca podawane są w formacie RRRR-MM-DD HH:MM:SS według strefy czasowej CEST WITH user_timetable(ut_username, ut_start_time, ut_end_time) AS ( SELECT "Msz2001", "2022-05-01 00:00:00", "2022-09-30 23:59:59" UNION ALL SELECT "Piastu", "2022-06-01 00:00:00", "2022-06-30 23:59:59" ), -- Przelicz daty na format MediaWiki user_timetable_mw(utm_username, utm_start_time, utm_end_time) AS ( SELECT ut_username, DATE_FORMAT(DATE_ADD(STR_TO_DATE(ut_start_time, "%Y-%m-%d %H:%i:%s"), INTERVAL -2 HOUR), "%Y%m%d%H%i%s") DATE_FORMAT(DATE_ADD(STR_TO_DATE(ut_end_time, "%Y-%m-%d %H:%i:%s"), INTERVAL -2 HOUR), "%Y%m%d%H%i%s") FROM user_timetable ) SELECT DATE_FORMAT( DATE_ADD( STR_TO_DATE(rev_timestamp, "%Y%m%d%H%i%s"), INTERVAL 2 HOUR -- Zakładamy, że jesteśmy w CEST, czyli 2 godziny do przodu względem UTC ), "%Y-%m-%d %H:%i:%s" ) AS "Czas", user_name AS "Użytkownik", CONCAT( CASE WHEN page_namespace = 10 THEN "Szablon:" WHEN page_namespace = 14 THEN "Kategoria:" ELSE "" END, REPLACE(page_title, "_", " ") ) AS "Strona" FROM revision JOIN page ON page_id = rev_page JOIN actor ON rev_actor = actor_id JOIN user ON actor_user = user_id JOIN user_timetable_mw ON user_name = utm_username AND rev_timestamp >= utm_start_time AND rev_timestamp < utm_end_time WHERE page_namespace IN (0, 10, 14) -- PG, szablon, kategoria ORDER BY rev_timestamp ASC;
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...