Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sample Table
- ----------
- ID | Ref1 | Ref2
- 1 | 41 | 42 |
- 2 | 42 | 41 |
- 3 | 42 | 43 |
- 4 | 42 | 41 |
- 5 | 42 | 43 |
- 6 | 43 | 42 |
- 7 | 43 | 44 |
- 8 | 43 | 42 |
- 9 | 44 | 43 |
- 10 | 53 | 54 |
- 11 | 54 | 53 |
- 11 | 54 | 55 |
- 11 | 55 | 54 |
- 11 | 56 | 57 |
- 11 | 57 | 56 |
- Desired Results
- ----------
- ID | Ref1 | Ref2 | New Column
- 1 | 41 | 42 | 1
- 2 | 42 | 41 | 1
- 3 | 42 | 43 | 1
- 4 | 42 | 41 | 1
- 5 | 42 | 43 | 1
- 6 | 43 | 42 | 1
- 7 | 43 | 44 | 1
- 8 | 43 | 42 | 1
- 9 | 44 | 43 | 1
- 10 | 53 | 54 | 2
- 11 | 54 | 53 | 2
- 11 | 54 | 55 | 2
- 11 | 55 | 54 | 2
- 11 | 56 | 57 | 3
- 11 | 57 | 56 | 3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement