withDistinctOn
Specifies that the SELECT
query should retrieve distinct results based on the given list of columns.
This method can be used to set a DISTINCT ON
clause for the query, which is supported by some SQL dialects (e.g., PostgreSQL, H2). The resulting query will retrieve rows that are distinct based on the specified columns.
Return
The current Query
instance with the DISTINCT ON
clause applied.
Parameters
The columns to apply the DISTINCT ON
clause.
Specifies that the SELECT
query should retrieve distinct results based on the given list of columns with sort orders. This method sets a DISTINCT ON
clause and may reorder the results as indicated.
This method can be used to set a DISTINCT ON
clause for the query, which is supported by some SQL dialects (e.g., PostgreSQL, H2), along with an ORDER BY
clause for the specified columns.
Return
The current Query
instance with the DISTINCT ON
clause and reordering applied.
Parameters
The columns and their sort orders to apply the DISTINCT ON
clause.