Skip to content

Instantly share code, notes, and snippets.

@spara
Last active January 25, 2016 22:52
Show Gist options
  • Save spara/1059783acdf0ae4dd21e to your computer and use it in GitHub Desktop.
Save spara/1059783acdf0ae4dd21e to your computer and use it in GitHub Desktop.
query of stackexchange data explorer
select [Month], Title, id, ViewCount, Score from
(
select CAST(
cast(DATEPART(YYYY, CreationDate) as varchar) + '-' + cast(DATEPART(MM, CreationDate) as varchar) + '-01'
as datetime) [Month],
Title,p.Id, ViewCount,Score
from Posts p
join PostTags pt on pt.PostId = p.Id
join Tags t on t.Id = pt.TagId
where TagName LIKE '%docker%'
-- and CreationDate >= convert(datetime, 'Jan 08 2016')
group by p.id, p.CreationDate, Title, ViewCount, Score
) as X
order by [Month] asc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment