3 ms·
something like this? SELECT TOP 50 * FROM [things] [post] JOIN [things] [category] ON [category].[id] = [post].[parent_id] WHERE [post].[type] = 'post' AND
by grandpoobah 4y ago
something like this?
SELECT TOP 50 * FROM [things] [post]
JOIN [things] [category] ON [category].[id] = [post].[parent_id]
WHERE [post].[type] = 'post'
AND [category].[type] = 'category'
AND [category].[slug] = 'animal-pictures'
ORDER BY ([post].[child_count] / DATEDIFF('hh', [post].[created_date], GETUTCDATE()) DESC;