Basic Max aggregate

Explanation is given above link. Please read here Select non-group by fields using sql query