I have a MySQL database with given content. I need to create a new column for each table, called ‘muid’ (migration unique id), and I need to fill each row with unique id in the following format: table_name_ + row_number.
So, the rows for the user table will be “user_0”, “user_1”, “user_2”.
I am currently doing this with PHP – but that takes lots and lots of time. Can this be done with MySQL at all?
I suspect there are a number of ways to solve this. My approach would be to do something like this:
In my test, this results in the muid column having values like mytable_1, mytable_2, etc.