G
In the database you have something like 1,2,3,4 and need to search for only one value, correct?
Really the ideal would be this not to happen, you could have a relationship table to store the service id and the agenda id, avoiding this type of field vector.
But as I believe you do not intend to change the structure, I suggest a solution alternative alternative (gambiarra): store the vector starting and finishing by comma, e.g. ,1,2,3,4,; with this, you can search for a number also starting and finishing by comma:SELECT
agenda.agen_id,
agenda.agen_data,
agenda.agen_turno,
group_concat(servico.serv_nome),
agenda.agen_total,
profissional.prof_comissao,
agenda.agen_obs,
profissional.prof_nome,
cliente.cli_nome
FROM
agenda
INNER JOIN servico ON 1 = 1 --a condição daqui será validada no where
INNER JOIN profissional ON agenda.prof_id = profissional.prof_id
INNER JOIN cliente ON agenda.cli_id = cliente.cli_id
WHERE LOCATE(CONCAT(',',servico.serv_id,','), agenda.serv_id) > 0
I used it https://www.w3schools.com/sql/func_mysql_concat.asp to change the service id only in search and https://www.w3resource.com/mysql/string-functions/mysql-locate-function.php in place of in to validate if the code (string) exists in the vector ids (the function returns > 0 if there is substring string original).NOTE: do not suggest you directly search the code (id) because you can return wrong data (e.g. search by 1 would return truth to id 11)