Q&A for administrators and users of the CiviCRM Constituent Relationship Management software
DECLARE @tag0 nvarchar(25) = N'laravel'; SELECT TOP 25000 p.Title AS Title, p.Body AS Body FROM Tags t JOIN PostTags pt ON pt.TagId = t.Id JOIN Posts p ON p.Id = pt.PostId WHERE t.TagName = @tag0 ORDER BY p.ViewCount / (1 + DATEDIFF(week, p.CreationDate, GETDATE())) DESC