How to fetch distinct values with arel/relational algebra and has_many :through
108727
rails - using :select(distinct) with :has_many :through association produces invalid SQL
123965
Why isn't oracle using an index for distinct query ?
146592
Is there a faster way to get UNION ALL behavior in Postgres?
63508
Trying to get distinct values from two List objects
35011
How can I count the number of records that have a unique value in a particular field in ROR?
55676
SQL distinct for 2 fields in a database
155351
Rails: Has and belongs to many (HABTM) -- create association without creating other records
42491
How do I efficiently get "the most recent corresponding row"?
30986
Combine two ActiveRecord::Relation objects
19952
Counting DISTINCT over multiple columns
6011
How do I build a SOQL query for records in a list of IDs?
104418
A QuerySet by aggregate field value
131409
Prolog fetch element in a sublist
90151
Return hierarchical data from a self-referencing table (parents, children)
113095
How do I retrieve all tuples from similar tables in a postgresql database?
102109
Want to find records with no associated records in Rails
104898
Proper notation for distinct sets