select id, max(field_d) from table_name group by field_a,field_b,field_c;
报错了 id must appear in the GROUP BY clause or be used in an aggregate function
所以 是不是只能用子查询了?
SELECT ID FROM table_name WHERE ( field_a, field_b, field_c, field_d) IN ( SELECT "field_a", "field_b", "field_c", MAX ( field_d ) AS "field_d" FROM "table_name" GROUP BY field_a, "field_b", "field_c" ORDER BY "field_a" DESC );