I have two 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
INNER JOIN artists AS ar ON (se.id IN (ar.art_ids))
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 | jack
sculptor | jill
sculptor | jeff
painter | jack
painter | jill
writer | jeff
Normally I would do this with a third table with the links pe.id<->se.id. But another table is quite complicated to maintain in my framework.
As mentioned above the best option is to fix your table structure, its best to do it now while you have the chance. As the data grows it will start causing a lot of headaches. However if you know what you are doing, i think this will get you what you want in the short term: