I currently have the below code. I want to be able to return only one row based on agentGuid which is now working, but I want it to return the newest record for that agentGuid based on the eventTime field.
SELECT TOP (100) PERCENT MAX(agentGuid) AS Expr1, MAX(result) AS Expr2, MAX(statusType) AS Expr3, MAX(statusType) AS Expr4, MAX(description)
AS Expr5, MAX(eventTime) AS Expr6
GROUP BY agentGuid