Hi @NachitoMax
Since you have a filter using job_id, unit_id & part_id, how about using TOP(1) along with ORDER BY instead of MAX() to get the max version_id. Check this:
SELECT TOP(1) version_id As MaxOfVersion,timestamp
FROM MyTable
WHERE job_id = 245 AND unit_id = 20 AND part_id = 1
ORDER BY version_id DESC
Best regards,
LiHong
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.