Ver Mensaje Individual
  #8  
Antiguo 14-12-2017
WHILENOTEOF WHILENOTEOF is offline
Miembro
 
Registrado: mar 2008
Posts: 229
Reputación: 17
WHILENOTEOF Va camino a la fama
Cita:
Empezado por duilioisola Ver Mensaje
En Firebird puedes utilizar tambié LIST() para estos campos agregados:

Código SQL [-]
/* LIST(CAMPO, SEPARADOR) devuelve un blob de valores separados por SEPARADOR */
SELECT P.APELLIDOS, P.NOMBRE, LIST(C.CARGO, ', ') AS LISTA_CARGOS
FROM PERSONA P, ELECTOS E, CARGOS C
WHERE
P.CODIGO = E.CODIGO AND
E.CODIGO = C.CODIGO AND
E.CARGO = C.CARGO   
GROUP BY P.APELLIDOS, P.NOMBRE

Código SQL [-]
APELLIDOS                  NOMBRE         LISTA_CARGOS
------------------------------------------------------
ABARCA CHAPARRO            PLACIDA        21
ABENGOZAR FERNANDEZ ARROYO MARGARITA      45
ABENGOZAR FERNANDEZ ARROYO MARIA JULIA    29, 21, 45
AGUADO MADRID              INOCENCIA      21
Interesante lo del LIST, ... tantos años usando Firebird y ahora descubro ese comando

Yo me iba a decantar por hablar seriamente con el presidente y hacerle ver que no es admisible que haya electos que acumulen más de un cargo
Responder Con Cita