SELECT TOP(5) MAX([a].[InsertedAt]), [a].[WorkOrderId] FROM [ArticleChange] AS [a] WHERE [a].[ArticleId] = 28413 AND [a].[DebtorId] = 84684 GROUP BY [a].[WorkOrderId] ORDER BY MAX([a].[InsertedAt]) DESC
712400cookie-checkSQL OrderBy Max example
SELECT TOP(5) MAX([a].[InsertedAt]), [a].[WorkOrderId] FROM [ArticleChange] AS [a] WHERE [a].[ArticleId] = 28413 AND [a].[DebtorId] = 84684 GROUP BY [a].[WorkOrderId] ORDER BY MAX([a].[InsertedAt]) DESC