X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=src%2Fdb%2Fsqlite%2Fsql%2Ftopic-publish-history.sql;fp=src%2Fdb%2Fsqlite%2Fsql%2Ftopic-publish-history.sql;h=184c449e780c079c3eeea4be50bb22f328f1e210;hb=737fbd003d5c4dfea81b667ef906f1c106a60612;hp=0000000000000000000000000000000000000000;hpb=17b4ff9c1974842c02071d2cd02144d2e5a99eb5;p=websub-hub diff --git a/src/db/sqlite/sql/topic-publish-history.sql b/src/db/sqlite/sql/topic-publish-history.sql new file mode 100644 index 0000000..184c449 --- /dev/null +++ b/src/db/sqlite/sql/topic-publish-history.sql @@ -0,0 +1,12 @@ +-- +SELECT + (strftime('%s', 'now') - content_updated) / 86400 AS days_ago, + count(*) AS content_updates +FROM topic_content_history +WHERE + days_ago <= :daysAgo +AND + (:topicId IS NULL OR topic_id = :topicId) +GROUP BY days_ago +ORDER BY days_ago +;