Select all columns from rows distinct on one column
问题 I am using Netezza (based on PostgreSQL) and need to select all columns in a table for rows distinct on one column. A related question with answer can be found here, but it doesn't handle the case with all columns, going by that answer throws an error: select distinct on (some_field) table1.* from table1 order by some_field; Snippet from error with real data: "(" (at char 77) expecting '')'' 回答1: I don't think your code should throw an error in Postgres. However, it won't do what you expect