I just watched the documentation and did what you suggested but I am still getting the same error message. I did the following test, what is wrong?
SELECT
facturas.fce_id,
facturas.fce_numero_factura,
facturas.fce_fecha,
compradores.com_nombre,
facturas.fce_subdivision,
facturas.fce_valor_comercial,
SUM(facsub.fce_valor_comercial) AS total
FROM
trafico.facturas_exportacion facturas
INNER JOIN trafico.cat_compradores compradores ON (facturas.fce_comprador = compradores.com_clave)
INNER JOIN trafico.facturas_exportacion facsub ON (facturas.fce_id = facsub.fce_id_factura_original)
WHERE
facturas.fce_subdivision = true
HAVING
facturas.fce_valor_comercial > total
GROUP BY facturas.fce_id,compradores.com_clave