Skip to content

Instantly share code, notes, and snippets.

@horaciod
Last active June 25, 2017 02:18
Show Gist options
  • Save horaciod/11b2046f9fbc2334033716854d640d78 to your computer and use it in GitHub Desktop.
Save horaciod/11b2046f9fbc2334033716854d640d78 to your computer and use it in GitHub Desktop.
recupera en una columna el resultado de una consulta de tabla relacionada
select x ,
(select array_to_json(array_agg(row_to_json(t))) from (select asistentes.apellido as evaluador, evaluacion from evaluadoresxresumen left join asistentes using(idasistente) where idresumen=resumenes.idresumen) t) as evals2
from xxx
@horaciod
Copy link
Author

para postgresql 9.5 o superior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment