Below is an example of the type of data I get (collected by different users):
name | surname |
---|---|
Moe | Momo |
Moe | Momo |
Jack | JAJA |
Jack | Jacky |
I would like to find when two users have collected different surnames for the same name.
The output I'm trying to get is:
name | surname |
---|---|
Moe | Momo |
Jack | NULL |
I would see the surname if all users have collected the same, and NULL if there are differences.
I tried searching the internet but I'm not able to describe what I'm searching properly.
I tried a request using CASE, but with no success.