I have a table with below data. In which I want to assign unique id to combination of two columns(emailid and collegeid) with or condition.
In the case of emp "1" and emp "2" has the same emailid but different collegeid still they are linked to each other by the emailid only.
In the case of emp "1" and emp "3" has the same collegeid but different emailid still they are linked to each other by the collegeid only.
In the case of emp "2" and emp "7" has the same collegeid but different emailid still they are linked to each other by the collegeid only.
All above empid are linked to each other through either emailid OR collegid, my desired output will be to assign same rownumber to all linked empid.
empid emailid collegeid row_number(**Desired Output**)
----------------------------------
1, n@gmail.com, 22, 1
2, n@gmail.com, 34, 1
3, k@gmail.com, 22, 1
4, p@gmail.com, 45, 2
5, m@gmail.com, 78, 3
6, m@gmail.com, 98, 3
7, s@gmail.com 34, 1
8, j@gmail.com, 48, 4
9, a@gmail.com 48, 4
Note :- I have 50 Millions records in my mysql table.