Sql Distinct Order By Postgresql W3schools