Hello people, good afternoon, I have to take data from several tables (related to each other), it brings me the data I need, but it repeats, I have given it several times and I do not see where the fault lies, my query is so:
SELECT
c.idCita, pa.idPaciente, prof.idRegistro, c.fecha_cita,
prof.nombres, prof.ape_pat, prof.ape_mat,
pa.rut_paciente, pa.nombres_paciente, pa.ape_pat, pa.ape_mat, pa.fecha_nacimiento,
h.hora,
ba.numBox
FROM
paciente pa INNER JOIN cita c
ON pa.idPaciente = c.idPaciente,
horas_atencion ha INNER JOIN hora h
ON ha.idHora = h.idHora,
boxes_atencion ba INNER JOIN horas_atencion sa
ON ba.idBox = sa.idBox,
profesional prof INNER JOIN horas_atencion h1
ON prof.idRegistro = h1.idRegistro
WHERE c.estado_cita= 'REGISTRADA';
Greetings to all, I appreciate your support from now ...