i have a table company row like this :
| id(int) | name(string) | maincategory(int) | subcategory(string) |
|---|---|---|---|
| 1 | 1 | 1,2,3 | |
| 2 | yahoo | 4 | 4,1 |
and other table category like:
| id(int) | name(string) |
|---|---|
| 1 | Search |
| 2 | |
| 3 | Image |
| 4 | Video |
i want to join tow table by company.subcategory = category.id
is it possible in sql ?
Start by splitting your
subcategorycolumn. In the end you should have an additionalcompany_categorytable with company_id and category_id as columns.