I have a question about a MYSQL query.
I have the following tables:
tabla: partidos
id_partido,
id_local_partido,
id_visita_partido,
estado_partido,
rdolocal_partido,
rdovisita_partido,
cancha_partido,
hora_partido,
torneo_partido,
jornada_partido,
fecha_partido
tabla equipos
id_equipo,
nombre_equipo
The issue is, I have to make a query that throws me the description of the game, but I can not make me put, instead of the team id, the name ... I've tried several days but I'm stuck.
The best I could do was make 2 inner join but repeat the records.
SELECT partidos.* , equipos.* FROM partidos INNER JOIN equipos ON (
equipos.id_equipo LIKE partidos.id_local_partido ) OR (equipos.id_equipo
LIKE partidos.id_visita_partido) WHERE partidos.jornada_partido = '1'
The result of this consultation is 18 records, but I need them to be 9 and show the name of the LOCAL team and the VISITOR since there are 9 matches per day.
I need to show:
id_partido | LOCAL | rdolocal_partido | VISITANTE | rdovisita_partido | cancha | hora
1 | RIVER | 0 | BOCA | 0 | CANCHA 1 | 13:00hs
I hope you explained, thank you very much!