I have two tables 'A' and 'B'. Table A has a field that is comma-separated values as follows : Table A (fields : project_name, model_types)
|project_name | | model_types |
project_animals detection,segmentation,detection,classification
I have table B with some information related to each model type listed above.
Table B (fields : model,labels,image_types)
| model | labels | image_types |
detection | cat,dog | jpg,png
segmentation | rat,dog | jpg,tif
classification| cow,cat | bmp,png
I need to read the labels and image_types for each model type listed in table A with a comma separate string. (no need to find unique)
Using the following SQL script, I could get the model_types string
select model_types from A where project_name = 'project_animals'
This will return model_types = 'detection,segmentation,detection,classification'.
So instead of reading table B with each item separately splited (model_types.split(',') outside mySQL and read again, how could I do it once in mySQL script.
So I need the results as follows from a single mySQL statement :
Model_types | labels | image_types
detection cat,dog jpg,png
segmentation rot,dog jpg,tif
detection cat,dog jpg,png
classification cow,cat bmp,png
Is it even possible?