Not sure the title really describes what I'm trying to do brilliantly so I'll try again...
I have three tables: companies, categories and a linking table where each company is linked to up to five categories.
I want to create a page that shows, for any particular comapny, the other companies listed in order of how similar they are in choice of category. So if one company has internet and computers linked to it, a second has internet and design and a third has design and print, the first has one match to the second but no matches to the third so the second would rank above the third in that companies page.
I'm sure it's possible to do this using a single SQL query but cannot work out how. Any help would be well appreciated,
Thanks
voidstate