Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT a.p_key, b.p_key
- FROM test AS a, test AS b
- WHERE
- a.p_key != b.p_key -- skip self
- AND a.p_key < b.p_key -- symmetry breaker
- -- missing extra condition to skip previously fetched results
- a.p_key p.b_key
- 1 2
- 1 3
- 2 3* (already linked to a.p_key = 1)
- 2 4
- 3 4* (already linked to a.p_key = 2)
- 3 5
- a.p_key p.b_key
- 1 2
- 1 3
- 2 4
- 3 5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement