过滤结果日期最大值时

Can anyone advise on what im doing wrong here?

I am trying to select a table full of results, some are duplicates, but the timestamp is different, so I want to filter out by the latest date.

I'm using the following sql query but it just keeps throwing up errors?

$sql = "(SELECT  *
FROM    measrate
WHERE TRANS_TIME = (SELECT MAX(TRANS_TIME) FROM measrate)";
sql = "(SELECT  * FROM    measrate WHERE TRANS_TIME = (SELECT MAX(TRANS_TIME) FROM measrate))";

Forgot last bracket

First, the initial parenthesis should be unnecessary:

SELECT m.*
FROM measrate m
WHERE TRANS_TIME = (SELECT MAX(TRANS_TIME) FROM measrate m2);

Second, if you want only the max time for some group -- say based on the column result -- then modify this to be a correlated subquery:

SELECT m.*
FROM measrate m
WHERE TRANS_TIME = (SELECT MAX(TRANS_TIME) FROM measrate m2 WHERE m2.result= m.result);