Ver Mensaje Individual
  #2 (permalink)  
Antiguo 29/09/2008, 06:30
jurena
Colaborador
 
Fecha de Ingreso: marzo-2008
Ubicación: Cáceres
Mensajes: 3.735
Antigüedad: 16 años, 1 mes
Puntos: 300
Respuesta: 1 query utilizando 2 tablas y concatenando el resultado

SELECT CONCAT(CAST (t1.id AS CHAR), ':') AS ID, GROUP_CONCAT(t2.nombre_grupo) AS GRUPOS, CONCAT (':',t1.nombre,', ', t1.apellidos) AS NOMBRE FROM tabla1 t1 LEFT JOIN tabla3 t3 ON t1.t3.idtabla1 INNER JOIN tabla2 t2 ON t3.idtabla2 = t2.id GROUP BY t1.id

No lo he probado

Última edición por jurena; 30/09/2008 a las 06:05