I have an issue on SQL Server. I have a table similar to this example:
Tabla inicial
You can notice I have duplicated values. It’s because they correspond to the same user. This happen cause the values can come from different many dbs.
I would like to assign them a new ID to identify them as the same user (as it should be) if they have same phone, same name or same email.
Something like this:
Tabla final
I have tried many functions in SQL, even some CTE’s but I just can’t find a way to achieve it. Could someone please give me an idea of which approximation should I use to solve this problem?
Jesús Méndez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.