I'm doing a small audit on our data and
I want to take a column that has a long string that separates product models with a comma and see if any of those models are not valid from separate table column. This validation is based on the model column of the manufacturer table.
So the manufacturer table has the following data:
Model | manufacurerid | manufacturername
xxx1 | 1 | delta
xxx2 | 1 | delta
xxx3 | 3 | alpha
xxx4 | 2 | beta
xxx5 | 1 | delta
xxx6 | 3 | alpha
The manufacturerenrollment table has the following data:
ManufacturerID | Model
1 | xxx1, xxx2, xxx4, xxx5
3 | xxx3, xxx6
- So i want to find out what model and manufacturer from the manufacturer table does match in the model column of the manufacturerenrollment table.
So the results would be the following because the xxx4 belongs to manufacturer 2 and not 1:
model | manufactuerid | manufacturer
xxx4 | 2 | beta
I would prefer not to use the contains function only for the mere fact that i don't have the rights to do a full-text index in the manufacturerenrollment table.
ASKER