i have 2 tables
[series]
--------------
ID | ART
--------------
1 | sculptor
2 | painter
3 | writer
-----------
[artists]
--------------
NAME | ART_IDs
--------------
john | 1
jack | 1,2
jill | 2,1
jeff | 3,1
which I want to join like this:
SELECT se.art, ar.name as artist
FROM series AS se
JOIN artists AS ar ON FIND_IN_SET(se.id , ar.art_ids) > 0
What I get is only the first values:
[result]
-------------------
ART | ARTISTS
-------------------
sculptor | john
sculptor | jack
painter | jill
writer | jeff
Instead of:
[result]
----------------------------
ART | ARTISTS
----------------------------
sculptor | john
sculptor,painter | jack
painter,sculptor | jill
writer,sculptor | jeff