Fork of
LRN year counts
by AntiCompositeNumber
This query is marked as a draft
This query has been published
by Bawolff.
SQL
AخA
USE commonswiki_p;
SELECT
LEFT(
ifnull(
(
SELECT
MIN(oi_timestamp)
from
oldimage
where
oi_name = page_title
),
img_timestamp
),
4
) AS `year`,
COUNT(*)
FROM
`page`
JOIN `image` on `page_title` = `img_name`
WHERE
`page_id` IN (
SELECT
`cl_from`
FROM
`categorylinks`
WHERE
`cl_to` = "License_review_needed"
)
GROUP BY
1
By running queries you agree to the Cloud Services Terms of Use and you irrevocably agree to release your SQL under CC0 License.
All SQL code is licensed under CC0 License.