結果 : postgres select max value for each group