The situation
On Microsoft SQL Server 2008, I have about 2 million rows. (this never happened, but we inherited the situation). Sample as follows:
usernum. | phone | email
1 | 123 | user1@local.com
2 | 123 | user2@local.com
3 | 245 | user3@local.com
4 | 678 | user3@local.com
Goal
I would like to create a table that looks like this. The idea is that if the “phone” or “email” are the same, they are assigned the same group number.
groupnum |usernum. | phone | email
1 | 1 | 123 | user1@local.com
1 | 2 | 123 | user2@local.com
2 | 3 | 245 | user3@local.com
2 | 4 | 678 | user3@local.com
python script, :
- usernum
-
- ,
- , usernum ( - )
Python script , . , , 10 000 , 2 . , t-sql, , python script, pyodbc.
, , sql.