1
Speak people, I have a problem at the time of searching a field in the datatable, i have a table of contributors, this is linked with the contributors_param, contributors_end and contributors_tel. I’m trying to do a search using like and Inner Join, until then the search by name, type_param, zip code and street, is working perfectly... now, the type_tel and phone_tel is repeating!!!!!
SELECT n_contribuintes.id_cont, n_contribuintes.nome_cont, n_contribuintes_param.tipo_param,
n_contribuintes_end.cep_end, n_contribuintes_end.rua_end, n_contribuintes_tel.tipo_tel,
n_contribuintes_tel.fone_tel FROM n_contribuintes
INNER JOIN n_contribuintes_param ON n_contribuintes.id_cont = n_contribuintes_param.id_cont_param
INNER JOIN n_contribuintes_end ON n_contribuintes.id_cont = n_contribuintes_end.id_cont_end
INNER JOIN n_contribuintes_tel ON n_contribuintes.id_cont = n_contribuintes_tel.id_cont_tel
AND nome_cont LIKE '%avulso%'
OR tipo_param LIKE '%avulso%'
OR cep_end LIKE '%avulso%'
OR rua_end LIKE '%avulso%'
OR tipo_tel LIKE '%avulso%'
OR fone_tel LIKE '%avulso%'
WHERE id_esc_cont = 30
GROUP BY id_cont
Testing:::
The
INNER JOIN
repeats the lines for each occurrence, in your case of phone and address. You want to show only 1?– Sorack
include the images in the question, many hosts are blocked and many people may not see, and it becomes clearer
– Ricardo Pontual
@Sorack yes, only what I research, but he repeats them all...
– JASL
@Ricardopunctual I tried, but it’s not working.
– JASL