union, go back to Ecto.Query module for more information.
A union query expression.
Combines result sets of multiple queries. The
select of each query
must be exactly the same, with the same types in the same order.
Union expression returns only unique rows as if each query returned
distinct results. This may cause a performance penalty. If you need
to combine multiple result sets without removing duplicate rows
Note that the operations
offset of the
query apply to the result of the union.
supplier_query = from s in Supplier, select: s.city from c in Customer, select: c.city, union: ^supplier_query
supplier_query = Supplier |> select([s], s.city) Customer |> select([c], c.city) |> union(^supplier_query)