0
I need to create a query on SQL
.
I have three tables:
TABELA 1: EMPRESA
emp_codigo (chave primaria)
emp_nome
TABELA 2: PALAVRAS_CHAVE
pal_codigo (chave primaria)
pal_nome
TABELA 3: VINCULO
vin_codigo (chave primaria)
vin_empresa (chave secundaria de emp_codigo)
vin_palavra (chave secundaria de pal_codigo)
I’m trying to build a query to display only keywords that have not been linked to the undertaking specified in the consultation.
Example:
we will consider that the key word table has 5 key words: A, B, C, D and E, and that the company "Good Idea Supermarket" has a link with the words A, C and E. Therefore, I need the query to return to me only B and D when this company is researched.
Detail: it is not only about listing records that have no match, but also filtering the records according to the company specified in the survey.
Duplicate of How to return only records without matching in a JOIN? or of How to create Mysql search that returns lines without matching?
– Bacco