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?HAVING facturas.fce_valor_comercial > total
WHERE clause is pre-grouping. What you want is the HAVING clause - though you have to repeat the expression (e.g., col > sum(...) ) as opposed to referring to it by name (e.g., col > total).http://www.postgresql.org/docs/devel/static/sql-select.html David J.
pgsql-novice by date:
Соглашаюсь с условиями обработки персональных данных