SELECT date_part('YEAR',"Postulante".
created) AS "Postulante__year", date_part('MONTH',"Postulante".created) AS
"Postulante__month", "Persona".genero AS "Postulante__genero",
count("Postulante".id) AS "Postulante__cuenta"
FROM "produccion"."postulantes" AS "Postulante" LEFT JOIN
"produccion"."personas" AS "Persona" ON ("Postulante"."persona_id" =
"Persona"."id")
WHERE "Postulante"."estado" = 1 AND date_part('YEAR',"Postulante".created)
= '2013'
GROUP BY "Persona"."genero", date_part('YEAR',"Postulante"."created"),
date_part('MONTH',"Postulante"."created")
ORDER BY date_part('YEAR',"Postulante".created) ASC,
date_part('MONTH',"Postulante".created) ASC


En la parte "Persona".genero AS "Postulante__genero" reelmplazar por
CASE "Persona".genero
WHEN M THEN 'Masculino' ELSE 'Femenino' END AS "Postulante__genero"


-- 
Sin más que decir se despide de Usted, muy atentamente

Cesar Erices Vergara
Ingeniero en Gestión Informática
Analista de Sistema
Especialista en ISO 27001 e ITIL

Cuenta Twitter: @caerices

Santiago - Chile

Responder a