I have these three tables in my database and because of a table (HNV) with sometimes not so logic productdescriptions I want to make a seperate table with extra keywords.
Main table with item nr. and not-so-logic product descriptions (can't be altered on my end).
HNV:
itemnr | productdescription
2424 | some text
3030 | some other text
4040 | text text
WEBGROUPS:
itemnr | webgrp
2424 | 401000
3030 | 502000
4040 | 502000
KEYWORDS:
webgrp | search
401000 | word1 word2 word3
502000 | word4 word 5
Right now my query looks like the one below:
SELECT KEYWORDS.Webgrp, HNV.itemNr, HNV.productdescription FROM WEBGROUPS INNER JOIN KEYWORDS ON WEBGROUPS.Webgrp = KEYWORDS.Webgrp INNER JOIN HNV ON WEBGROUPS.itemNr = HNV.itemNr
WHERE KEYWORDS.search LIKE '%word1%'
If a user search for something the query will look in 'KEYWORDS.search' for any matching words. But how do I expand the query above to also look in 'HNV.productdescription' for any match?