When trying to use HAVING
in a SQL query is returning the following error:
Mensagem 8121, Nível 16, Estado 1, Linha 15 Column 'V_DADOSFUNC.FILIAL' is invalid in the HAVING clause because it is not contained in either an aggregate function or the GROUP BY clause.