Use this tag for questions relevant to DISTINCT ON, which is used to eliminate rows that match on all specified expressions.
I want to run this query: SELECT DISTINCT ON (address_id) purchases.address_id, purchases.* FROM purchases WHERE purchases.product_…
sql postgresql sql-order-by distinct-onIn PostgreSQL i want to fetch every users at once and order them by date. This is my query: SELECT …
postgresql group-by distinct distinct-onI understand how DISTINCT works, but I don't understand DISTINCT ON (expression). Take the first example from this screenshot: How …
sql database postgresql mod distinct-onFor the following query I need to select only the first record with the lowest shape_type value (ranges from 1 …
sql postgresql distinct greatest-n-per-group distinct-onI have a rails app: user has_many :projects user has_many :tasks, :through => :projects project has_many :tasks …
ruby-on-rails-3 activerecord sql-order-by distinct-onRelated to - PostgreSQL DISTINCT ON with different ORDER BY I have table purchases (product_id, purchased_at, address_id) …
postgresql greatest-n-per-group distinct-onI just came across a SQL query, specifically against a Postgres database, that uses a function named "distinct". Namely: select …
sql postgresql distinct distinct-onIs it possible to select rows that are DISTINCT ON some separate, independent sets of columns? Suppose I want all …
sql postgresql duplicates distinct-onI'm trying to submit a query in Postgres that only returns distinct tuples. In my sample query, I do not …
sql postgresql distinct-onI try to use "distinct on" with doctrine but I get the following error: Error: Expected known function, got 'on' …
php symfony doctrine-orm distinct distinct-on