method

columns_for_distinct

Importance_1
columns_for_distinct(columns, orders) public

Given a set of columns and an ORDER BY clause, returns the columns for a SELECT DISTINCT. PostgreSQL, MySQL, and Oracle override this for custom DISTINCT syntax - they require the order columns appear in the SELECT.

columns_for_distinct("posts.id", ["posts.created_at desc"])
Show source
Register or log in to add new notes.