Forked from stevecondylios/most-viewed-stack-overflow-questions.sql
Created
October 22, 2022 21:13
-
-
Save subratrout/3fd88f2f90e662a450d2b12b7019ec26 to your computer and use it in GitHub Desktop.
Query for the Stack Exchange Data Explorer https://data.stackexchange.com/stackoverflow/query/new
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
'https://stackoverflow.com/questions/' + CONVERT(VARCHAR, Posts.Id) as url, | |
( | |
ViewCount / (SELECT -DATEDIFF(DAY, GETDATE() , CreationDate)) | |
) AS ave_views_per_day, | |
* | |
FROM | |
Posts | |
LEFT JOIN PostTags ON Posts.Id = PostTags.PostId | |
LEFT JOIN Tags ON PostTags.TagId = Tags.Id | |
WHERE TagName IN ('google-bigquery') | |
AND ViewCount > 10000 -- set to some sensible value | |
-- ORDER BY ave_views_per_day DESC | |
ORDER BY Score DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment