Skip to content

Instantly share code, notes, and snippets.

@johnboxall
Created February 2, 2009 17:11
Show Gist options
  • Save johnboxall/56984 to your computer and use it in GitHub Desktop.
Save johnboxall/56984 to your computer and use it in GitHub Desktop.
SELECT person.id, person.name, person.parent_id
FROM person
INNER JOIN person T2 ON (person.parent_id = T2.id)
INNER JOIN person T3 ON (T2.parent_id = T3.id) WHERE T3.name = "Grandpa"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment