SELECT '2015-05-01' as date, COUNT(DISTINCT(Posts.OwnerUs...

0

Please login or register to vote for this query.

(click on this box to dismiss)

スタック・オーバーフローMeta

プログラマーと熱狂的なプログラマーのためのサイトに関する質問と回答

SELECT '2015-05-01' as date, COUNT(DISTINCT(Posts.OwnerUserId)) FROM Posts LEFT JOIN Votes on Votes.PostId = Posts.Id LEFT JOIN PostTags on PostTags.PostId = Posts.Id LEFT JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName IN (  'tableau-api')  AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01') ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  >= '2008-10-01' AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01')  ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  < '2015-05-01' UNION
SELECT '2015-06-01' as date, COUNT(DISTINCT(Posts.OwnerUserId)) FROM Posts LEFT JOIN Votes on Votes.PostId = Posts.Id LEFT JOIN PostTags on PostTags.PostId = Posts.Id LEFT JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName IN (  'tableau-api')  AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01') ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  >= '2008-10-01' AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01')  ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  < '2015-06-01' UNION
SELECT '2015-07-01' as date, COUNT(DISTINCT(Posts.OwnerUserId)) FROM Posts LEFT JOIN Votes on Votes.PostId = Posts.Id LEFT JOIN PostTags on PostTags.PostId = Posts.Id LEFT JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName IN (  'tableau-api')  AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01') ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  >= '2008-10-01' AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01')  ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  < '2015-07-01' UNION
SELECT '2015-08-01' as date, COUNT(DISTINCT(Posts.OwnerUserId)) FROM Posts LEFT JOIN Votes on Votes.PostId = Posts.Id LEFT JOIN PostTags on PostTags.PostId = Posts.Id LEFT JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName IN (  'tableau-api')  AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01') ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  >= '2008-10-01' AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01')  ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  < '2015-08-01' UNION
SELECT '2015-09-01' as date, COUNT(DISTINCT(Posts.OwnerUserId)) FROM Posts LEFT JOIN Votes on Votes.PostId = Posts.Id LEFT JOIN PostTags on PostTags.PostId = Posts.Id LEFT JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName IN (  'tableau-api')  AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01') ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  >= '2008-10-01' AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01')  ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  < '2015-09-01' UNION
SELECT '2015-10-01' as date, COUNT(DISTINCT(Posts.OwnerUserId)) FROM Posts LEFT JOIN Votes on Votes.PostId = Posts.Id LEFT JOIN PostTags on PostTags.PostId = Posts.Id LEFT JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName IN (  'tableau-api')  AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01') ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  >= '2008-10-01' AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01')  ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  < '2015-10-01' UNION
SELECT '2015-11-01' as date, COUNT(DISTINCT(Posts.OwnerUserId)) FROM Posts LEFT JOIN Votes on Votes.PostId = Posts.Id LEFT JOIN PostTags on PostTags.PostId = Posts.Id LEFT JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName IN (  'tableau-api')  AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01') ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  >= '2008-10-01' AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01')  ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  < '2015-11-01' UNION
SELECT '2015-12-01' as date, COUNT(DISTINCT(Posts.OwnerUserId)) FROM Posts LEFT JOIN Votes on Votes.PostId = Posts.Id LEFT JOIN PostTags on PostTags.PostId = Posts.Id LEFT JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName IN (  'tableau-api')  AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01') ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  >= '2008-10-01' AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01')  ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  < '2015-12-01' UNION
SELECT '2016-01-01' as date, COUNT(DISTINCT(Posts.OwnerUserId)) FROM Posts LEFT JOIN Votes on Votes.PostId = Posts.Id LEFT JOIN PostTags on PostTags.PostId = Posts.Id LEFT JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName IN (  'tableau-api')  AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01') ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  >= '2008-10-01' AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01')  ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  < '2016-01-01' UNION
SELECT '2016-02-01' as date, COUNT(DISTINCT(Posts.OwnerUserId)) FROM Posts LEFT JOIN Votes on Votes.PostId = Posts.Id LEFT JOIN PostTags on PostTags.PostId = Posts.Id LEFT JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName IN (  'tableau-api')  AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01') ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  >= '2008-10-01' AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01')  ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  < '2016-02-01' UNION
SELECT '2016-03-01' as date, COUNT(DISTINCT(Posts.OwnerUserId)) FROM Posts LEFT JOIN Votes on Votes.PostId = Posts.Id LEFT JOIN PostTags on PostTags.PostId = Posts.Id LEFT JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName IN (  'tableau-api')  AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01') ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  >= '2008-10-01' AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01')  ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  < '2016-03-01' UNION
SELECT '2016-04-01' as date, COUNT(DISTINCT(Posts.OwnerUserId)) FROM Posts LEFT JOIN Votes on Votes.PostId = Posts.Id LEFT JOIN PostTags on PostTags.PostId = Posts.Id LEFT JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName IN (  'tableau-api')  AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01') ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  >= '2008-10-01' AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01')  ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  < '2016-04-01' UNION
SELECT '2016-05-01' as date, COUNT(DISTINCT(Posts.OwnerUserId)) FROM Posts LEFT JOIN Votes on Votes.PostId = Posts.Id LEFT JOIN PostTags on PostTags.PostId = Posts.Id LEFT JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName IN (  'tableau-api')  AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01') ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  >= '2008-10-01' AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01')  ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  < '2016-05-01' UNION
SELECT '2016-06-01' as date, COUNT(DISTINCT(Posts.OwnerUserId)) FROM Posts LEFT JOIN Votes on Votes.PostId = Posts.Id LEFT JOIN PostTags on PostTags.PostId = Posts.Id LEFT JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName IN (  'tableau-api')  AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01') ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  >= '2008-10-01' AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01')  ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  < '2016-06-01' UNION
SELECT '2016-07-01' as date, COUNT(DISTINCT(Posts.OwnerUserId)) FROM Posts LEFT JOIN Votes on Votes.PostId = Posts.Id LEFT JOIN PostTags on PostTags.PostId = Posts.Id LEFT JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName IN (  'tableau-api')  AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01') ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  >= '2008-10-01' AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01')  ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  < '2016-07-01' UNION
SELECT '2016-08-01' as date, COUNT(DISTINCT(Posts.OwnerUserId)) FROM Posts LEFT JOIN Votes on Votes.PostId = Posts.Id LEFT JOIN PostTags on PostTags.PostId = Posts.Id LEFT JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName IN (  'tableau-api')  AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01') ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  >= '2008-10-01' AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01')  ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  < '2016-08-01' UNION
SELECT '2016-09-01' as date, COUNT(DISTINCT(Posts.OwnerUserId)) FROM Posts LEFT JOIN Votes on Votes.PostId = Posts.Id LEFT JOIN PostTags on PostTags.PostId = Posts.Id LEFT JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName IN (  'tableau-api')  AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01') ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  >= '2008-10-01' AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01')  ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  < '2016-09-01' UNION
SELECT '2016-10-01' as date, COUNT(DISTINCT(Posts.OwnerUserId)) FROM Posts LEFT JOIN Votes on Votes.PostId = Posts.Id LEFT JOIN PostTags on PostTags.PostId = Posts.Id LEFT JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName IN (  'tableau-api')  AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01') ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  >= '2008-10-01' AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01')  ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  < '2016-10-01' UNION
SELECT '2016-11-01' as date, COUNT(DISTINCT(Posts.OwnerUserId)) FROM Posts LEFT JOIN Votes on Votes.PostId = Posts.Id LEFT JOIN PostTags on PostTags.PostId = Posts.Id LEFT JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName IN (  'tableau-api')  AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01') ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  >= '2008-10-01' AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01')  ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  < '2016-11-01' UNION
SELECT '2016-12-01' as date, COUNT(DISTINCT(Posts.OwnerUserId)) FROM Posts LEFT JOIN Votes on Votes.PostId = Posts.Id LEFT JOIN PostTags on PostTags.PostId = Posts.Id LEFT JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName IN (  'tableau-api')  AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01') ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  >= '2008-10-01' AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01')  ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  < '2016-12-01' UNION
SELECT '2017-01-01' as date, COUNT(DISTINCT(Posts.OwnerUserId)) FROM Posts LEFT JOIN Votes on Votes.PostId = Posts.Id LEFT JOIN PostTags on PostTags.PostId = Posts.Id LEFT JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName IN (  'tableau-api')  AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01') ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  >= '2008-10-01' AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01')  ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  < '2017-01-01' UNION
SELECT '2017-02-01' as date, COUNT(DISTINCT(Posts.OwnerUserId)) FROM Posts LEFT JOIN Votes on Votes.PostId = Posts.Id LEFT JOIN PostTags on PostTags.PostId = Posts.Id LEFT JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName IN (  'tableau-api')  AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01') ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  >= '2008-10-01' AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01')  ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  < '2017-02-01' UNION
SELECT '2017-03-01' as date, COUNT(DISTINCT(Posts.OwnerUserId)) FROM Posts LEFT JOIN Votes on Votes.PostId = Posts.Id LEFT JOIN PostTags on PostTags.PostId = Posts.Id LEFT JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName IN (  'tableau-api')  AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01') ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  >= '2008-10-01' AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01')  ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  < '2017-03-01' UNION
SELECT '2017-04-01' as date, COUNT(DISTINCT(Posts.OwnerUserId)) FROM Posts LEFT JOIN Votes on Votes.PostId = Posts.Id LEFT JOIN PostTags on PostTags.PostId = Posts.Id LEFT JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName IN (  'tableau-api')  AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01') ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  >= '2008-10-01' AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01')  ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  < '2017-04-01' UNION
SELECT '2017-05-01' as date, COUNT(DISTINCT(Posts.OwnerUserId)) FROM Posts LEFT JOIN Votes on Votes.PostId = Posts.Id LEFT JOIN PostTags on PostTags.PostId = Posts.Id LEFT JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName IN (  'tableau-api')  AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01') ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  >= '2008-10-01' AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01')  ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  < '2017-05-01' UNION
SELECT '2017-06-01' as date, COUNT(DISTINCT(Posts.OwnerUserId)) FROM Posts LEFT JOIN Votes on Votes.PostId = Posts.Id LEFT JOIN PostTags on PostTags.PostId = Posts.Id LEFT JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName IN (  'tableau-api')  AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01') ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  >= '2008-10-01' AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01')  ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  < '2017-06-01' UNION
SELECT '2017-07-01' as date, COUNT(DISTINCT(Posts.OwnerUserId)) FROM Posts LEFT JOIN Votes on Votes.PostId = Posts.Id LEFT JOIN PostTags on PostTags.PostId = Posts.Id LEFT JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName IN (  'tableau-api')  AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01') ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  >= '2008-10-01' AND CASE WHEN Votes.CreationDate IS NOT NULL THEN CONCAT(YEAR(Votes.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Votes.CreationDate)), 2) , '-01')  ELSE CONCAT(YEAR(Posts.CreationDate), '-', RIGHT('0' + CONVERT(varchar(10), MONTH(Posts.CreationDate)), 2) , '-01') END  < '2017-07-01'

Enter Parameters

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