Ver Mensaje Individual
  #2 (permalink)  
Antiguo 09/10/2019, 12:51
Avatar de Libras
Libras
Colaborador
 
Fecha de Ingreso: agosto-2006
Ubicación: En la hermosa perla de occidente
Mensajes: 7.412
Antigüedad: 17 años, 8 meses
Puntos: 774
Respuesta: Diferenciar campos con mismo nombre en inner join

seleccionando las columnas en el select y usando alias:

Código SQL:
Ver original
  1. SELECT t1.id AS id_1, t2.id AS id_2, t3.id AS id_3  FROM matches
  2. INNER JOIN teams AS t1 ON matches.localTeam=t1.id
  3. INNER JOIN teams AS t2 ON matches.visitingTeam=t2.id
  4. INNER JOIN reservations AS r ON matches.id=r.refered
__________________
What does an execution plan say to t-sql query? Go f**k yourself, if you are not happy with me