Advertisement
Guest User

Untitled

a guest
Aug 17th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. SELECT a.p_key, b.p_key
  2. FROM test AS a, test AS b
  3. WHERE
  4. a.p_key != b.p_key -- skip self
  5. AND a.p_key < b.p_key -- symmetry breaker
  6. -- missing extra condition to skip previously fetched results
  7.  
  8. a.p_key p.b_key
  9. 1 2
  10. 1 3
  11.  
  12. 2 3* (already linked to a.p_key = 1)
  13. 2 4
  14.  
  15. 3 4* (already linked to a.p_key = 2)
  16. 3 5
  17.  
  18. a.p_key p.b_key
  19. 1 2
  20. 1 3
  21.  
  22. 2 4
  23.  
  24. 3 5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement