Skip to content
Advertisement

How to query all the new tags created last week from Stack Exchange data Explorer?

I want to query SO new tags created during last week. We have tables Posts,Tags, PostTags (leave out TagSynonyms for now).

Tags doesn’t have CreationDate so we probably need to use join with min(Post.CreationDate)

Advertisement

Answer

This query will produce a list of posts that the tags are created the past week. The JOIN between the tables is only to bring information. The WHERE clause would exclude tags which have been used prior to the 7 days.

The subquery will produce a list of unique tag IDs that where used in the past. Following your last week example in question, the formula is created by using the DATEDIFF function.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement