I'm setting up a search system, where the user types in a search box any word, eg "Programmer", mysql will have to search that word in several fields in several tables, if by chance he finds that word in some place get back to me who is the professional that gets that word.
Below are the tables and the query I'm currently using, but it's not very functional.
Tables / Columns
Professional:
id
Pri_name
about_name
enderenco_professional:
id
professional_id
status
city
historico_escolar:
id
professional_id
schooling
Experience:
id
professional_id
charge
Query that I'm trying to get right!
SELECT a.id FROM profissional a, endereco_profissional b, historico_escola c, experiencia d WHERE a.pri_nome LIKE '%programador%' OR a.sobre_nome LIKE '%programador%' OR b.estado LIKE '%programador%' OR b.cidade LIKE '%programador%' OR c.escolaridade LIKE '%programador%' OR d.cargo LIKE '%programador%' OR a.id = b.id_profissional OR a.id = c.id_profissional OR a.id=d.id_profissional OR a.id=e.id_profissional OR a.id=f.id_profissional GROUP BY a.id