I have a database table, which a program is about to update. I have taken a snapshot of the table before the program ran and a snapshot afterwards. Here is a sample of the data:
Before update:
JoinReference User
1 User 1
1 User 2
1 User 3
2 User 4
2 User 5
2 User 6
After update:
JoinReference User
3 User 1
3 User 2
3 User 3
4 User 4
4 User 5
5 User 6
I am trying to find all the users that are not linked together after the update. For example, user 1; user 2 and user 3 are linked before and after the update (even though they have a different join reference). User 4 and five are still linked after the update. User 6 is not linked after the update. I am trying to return user 6 after the update. I have tried using derived tables but it has not worked.
This is for a very large database. The example I have given uses fields I have made up to explain the problem. The database structure for the example would be like this:
CREATE TABLE JoinedUsers (JoinReference int, User)
or