top | item 32417749 (no title) itwy | 3 years ago How does this really work if a developer wants to pull most recent discussions posted in in X category, having most number of replies when I only have to tables? discuss order hn newest grandpoobah|3 years 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;
grandpoobah|3 years 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;
grandpoobah|3 years ago
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;