I have the following situation
CROSS APPLY (select top 1 seq.id_prod,
seq.id_emp,
seq.localizacao,
seq.localizacao_modulo,
seq.localizacao_nivel,
seq.localizacao_rua,
seq.localizacao_vao,
qtde
from eq_prod_qtde seq
where seq.id_prod = p.id_prod
and seq.id_emp = pc.id_emp) ES
CROSS APPLY (select sum(qtde)
qtde
from eq_prod_qtde seq
where seq.id_prod = p.id_prod) ES1
But I'm having a hard time doing this same process for postgres.