This still isn't right -- older versions of PostgreSQL won't like selecting columns that aren't included in the GROUP BY. Either of the approaches I suggested before (ORDER BY ... LIMIT 1, or LEFT JOIN) would work.