SQL OrderBy Max example

Date: 2022-12-19
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
71240cookie-checkSQL OrderBy Max example