Advertisement
infogulch

Untitled

Jun 2nd, 2012
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.25 KB | None | 0 0
  1. SELECT id, parent_id, name
  2. FROM nodes
  3. WHERE parent_id IN (SELECT descendant FROM closures GROUP BY descendant);
  4.  
  5. -- wtf:
  6. -- there is only one row in closures
  7. -- it's descendant id is 5
  8. -- none of the rows returned by this query have a parent_id of 5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement