Have a bit of a strange query request for our MySQL database.
Table "product" is like this:
brandid int
shopid int
name varchar(255)
name is always 1+ words separated by " ". For example "Lenovo laptop X1".
I need to get the all the words that appears in names for 2+ brandid and 2+ shopid (i.e. to be selected, a word must appear in products for at least 2 different brandid's and at least 2 different shopids's).
Someone got an idea for writing such a query?
PS: Performance is not critical, but it might be worth mentioning that the table has ~3 million rows...