Ver Mensaje Individual
  #6 (permalink)  
Antiguo 09/09/2009, 00:33
jurena
Colaborador
 
Fecha de Ingreso: marzo-2008
Ubicación: Cáceres
Mensajes: 3.735
Antigüedad: 16 años, 1 mes
Puntos: 300
Respuesta: Se puede hacer esta consulta???

chelodelsur:
Si la estructura de tabla para los 8 tipos es la misma, creo que te has equivocado de estructura. Te habría bastado con 3 tablas
una bitacora, otra evento en la que añadirías un campo numérico,una FK para distinguir los 8 tipos, y una tercera para los tipos, con su PK, el nombre y algún otro campo.
De esa forma te bastaría hacer INNER JOIN entre las tres tablas para sacar el listado y un group y group_concat si quieres presentarlo de esa otra manera, aunque eso también puedes hacerlo con programación. Ten cuidado con el group_concat, que tiene límite y vas a introducir datos de campo TEXT de varios registros, hasta 8.
Cita:
The result is truncated to the maximum length that is given by the group_concat_max_len system variable, which has a default value of 1024. The value can be set higher, although the effective maximum length of the return value is constrained by the value of max_allowed_packet. The syntax to change the value of group_concat_max_len at runtime is as follows, where val is an unsigned integer: