select yearly count of odd rfc links

0

Please login or register to vote for this query.

(click on this box to dismiss)

We know that there are different types of posts, as reflected by the PostTypeID: the original posts (i.e., 1), follow up posts (i.e., 2), survey questions (i.e., 4), and unknown (i.e., 5). Please use SQL to get the number of posts by year-month and by post type. The results table should show: year, month, posttypeid, and count (label: cnt). Use this result to answer the following question: which year-month has the most original posts?

Motor Vehicle Maintenance and Repair Meta

Q&A about the site for mechanics and DIY enthusiast owners of cars, trucks, and motorcycles

WITH pattern(url) AS (
SELECT v
FROM (VALUES
('%ftp://ftp.rfc-editor.org/%' ),
( '%://www.ietf.org/rfc/rfc[0-9][0-9][0-9]%' ),
( '%://www.faqs.org/rfcs/rfc[0-9][0-9][0-9]%' ),
( '%://www.w3.org/Protocols/%' ),
( '%://www.apps.ietf.org/rfc/%' ),
( '%://www.dkim.org/specs/rfc%' ),
( '%://www.openspf.org/svn/project/specs/%' ),
('%://www.isi.edu/in-notes/rfc%')
    ) v(v)
    )
SELECT year(creationdate) as year, pattern.url, count(distinct id) AS number_of_posts
FROM pattern
LEFT JOIN posts
ON (posts.body LIKE pattern.url)
group by year(creationdate),pattern.url ORDER BY year;

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results