4 ms·
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
by itwy 4y 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?
- grandpoobah 4y agosomething 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;