Link to home
Start Free TrialLog in
Avatar of Southern_Gentleman
Southern_GentlemanFlag for United States of America

asked on

Use column to search string column

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 CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Southern_Gentleman

ASKER

Thanks Jim, that was a great article. It will work perfect for my scenario