Skip to content

Instantly share code, notes, and snippets.

@mreigen
Last active February 16, 2021 05:35
Show Gist options
  • Save mreigen/bafed69946e6f2a5a454b7497a8f6b3e to your computer and use it in GitHub Desktop.
Save mreigen/bafed69946e6f2a5a454b7497a8f6b3e to your computer and use it in GitHub Desktop.
import Ecto.Query
...
from(store in Store,
where: fragment("NOT EXISTS (SELECT * FROM APPLIANCES item WHERE item.store_id == ? AND item.name == 'VCR player')", store.id),
where: fragment("NOT EXISTS (SELECT * FROM GAME_CONSOLES item WHERE item.store_id == ? AND item.name == 'Sega Genesis console')", store.id)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment