Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created Jan 17, 2022
Embed
What would you like to do?
select e.nombre, e.apellido_paterno, e.apellido_materno, e.sueldo,
(
select coalesce(json_agg(bonos), '[]')
from (
select cantidad,
concepto
from bonos_empleado_nomina
where id_nomina = 3
and id_empleado = e.id
) bonos
) bonos
from empleados e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment