Skip to content

Instantly share code, notes, and snippets.

@fabiotatsuo
Created May 5, 2014 20:24
Show Gist options
  • Save fabiotatsuo/98b8c9d57a322737e25c to your computer and use it in GitHub Desktop.
Save fabiotatsuo/98b8c9d57a322737e25c to your computer and use it in GitHub Desktop.
Query exemplo many to many
SELECT DISTINCT nome, email
FROM usuario u
INNER JOIN entidade e
ON e.usuario_id = u.id
INNER JOIN pessoa_fisica p
ON p.id = e.pessoaFisica_id
WHERE email IS NOT NULL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment