我有一個表包含了諸如列索引表:如何創建一個基於現有的表在MySQL
time tv_program user_name
xxx friends John
xxx Game of Thrones Kate
...
...
現在我想創建單獨的索引表tv_program和USER_NAME喜歡:
id tv_program
1 friends
2 Game of Thrones
3 ...
4 ...
id user_name
1 John
2 Kate
3 ...
4 ...
並更新原始表格,用索引號碼替換tv_program和user_name,而不是像
time tv_program user_name
xxx 1 1
xxx 2 2
... ... ...
有沒有簡單的方法來做到這一點?非常感謝!!