I want get the maximum value for this record. Please help me:
SELECT rest.field1 FROM mastertable AS m INNER JOIN ( SELECT t1.field1 field1
As you've noticed, the WHERE clause doesn't allow you to use aggregates in it. That's what the HAVING clause is for.
WHERE
HAVING
HAVING t1.field3=MAX(t1.field3)