Skip to content

Instantly share code, notes, and snippets.

@fwojciec
Created January 20, 2020 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fwojciec/139d9ee1d760171a24c30e0e86e8b105 to your computer and use it in GitHub Desktop.
Save fwojciec/139d9ee1d760171a24c30e0e86e8b105 to your computer and use it in GitHub Desktop.
-- name: ListAuthorsByBookIDs :many
SELECT authors.*, book_authors.book_id FROM authors, book_authors
WHERE book_authors.author_id = authors.id AND book_authors.book_id = ANY($1::bigint[]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment