I would first have to recommend you normalize your table -- you shouldn't be storing a list of results in a single column. If possible, consider creating a User_Language
table which stores the User_Id
and the Language_Id
.
However, you can achieve the same results using FIND_IN_SET
and REPLACE
:
select u.name, l.name language
from user u
join languages l on find_in_set(l.id, replace(u.spoken_lang,';',','))