Created
September 9, 2016 04:30
-
-
Save telnicky/e8a64b90ccf6f781e99b97d7455b3e6f to your computer and use it in GitHub Desktop.
Raw sql query in ecto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query = """ | |
SELECT id, name, inserted_at | |
FROM users | |
UNION | |
SELECT id, name, inserted_at | |
FROM customers | |
WHERE name = $1 | |
""" | |
Ecto.Adapters.SQL.query!(MyApp.Repo, query, ["Carol"]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment