I am a newbie in this programming (I am in formation), look for the following, waiting for your help and clarification.
My system works as follows:
1st. table participante
, where I store basic student data, names, surnames, identification cards, registration date
2nd. table participante_has_trabajo
where I relate the Id
of Participante
with the id of trabajo
3rd. table trabajo
where I store the name of the work and the unique data of both participants such as career, mention, core, the Id of the date in which it was registered since this is the one that will allow me to locate the records I want.
I make the query to the database in the following way:
SELECT * FROM participante_has_trabajo
inner join participante on participante_has_trabajo.participante_ipte = participante.ipte
inner join trabajo on participante_has_trabajo.trabajo_id = trabajo.id
inner join fecha_hora on trabajo.fecha_hora_idf = fecha_hora.idf
inner join nucleo on trabajo.nucleo_idn = nucleo.idn
inner join mencion on trabajo.mencion_idm = mencion.idm
inner join carrera on mencion.carrera_idc = carrera.idc
where fecha BETWEEN '2018-08-06' and '2018-08-06' ORDER BY trabajo.id
If I have two participants associated with a trabajo_id
, in the table participant_has_work brings me the data but as individual records
What I want to do is, in the case that a job has two associated participants as it would do to join those two participants to a single job title
I appreciate your help a greeting ...