Cassandra, CQL posts per year

0

Please login or register to vote for this query.

(click on this box to dismiss)

Russian Language

Q&A for students, teachers, and linguists wanting to discuss the finer points of the Russian language

SELECT YEAR(p.creationdate) as year, SUM(1) as questionCount, 'Cassandra Questions' as type
FROM PostTags pt
INNER JOIN Posts p ON p.id = pt.postid
WHERE pt.TagId = 34113
AND p.posttypeid=1
GROUP BY YEAR(p.creationdate)
UNION
SELECT YEAR(p.creationdate) as year, SUM(1) as answerCount, 'Cassandra Answers' as type
FROM PostTags pt
INNER JOIN Posts p ON p.id = pt.postid
WHERE pt.TagId = 34113
AND p.posttypeid=2
GROUP BY YEAR(p.creationdate)
UNION
SELECT YEAR(p.creationdate) as year, SUM(1) as questionCount, 'HBase Questions' as type
FROM PostTags pt
INNER JOIN Posts p ON p.id = pt.postid
WHERE pt.TagId = 2394
AND p.posttypeid=1
GROUP BY YEAR(p.creationdate)
UNION
SELECT YEAR(p.creationdate) as year, SUM(1) as answerCount, 'HBase Answers' as type
FROM PostTags pt
INNER JOIN Posts p ON p.id = pt.postid
WHERE pt.TagId = 2394
AND p.posttypeid=2
GROUP BY YEAR(p.creationdate)

Enter Parameters

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