Let's say we have the table like
id | group_id | TEXT |
--------------------------------------
1 | | NBA
--------------------------------------
2 | | NHL
--------------------------------------
3 | | NBA
--------------------------------------
4 | | NHL
--------------------------------------
5 | | NHL
--------------------------------------
Is it possible to create group_id with a MySQL function or query or anything :) using the fact of repeating (duplicate) text in the column TEXT ? to have a table like that
id | group_id | TEXT |
--------------------------------------
1 | 10 | NBA
--------------------------------------
2 | 11 | NHL
--------------------------------------
3 | 10 | NBA
--------------------------------------
4 | 11 | NHL
--------------------------------------
5 | 11 | NHL
--------------------------------------