How to use having together with view in sql server

Asked

Viewed 70 times

1

When trying to use the HAVING in an 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.
  • you can post the whole query (select, from, group)?

  • You should post the entire SQL that causes the error, although it was possible to estimate a solution.

1 answer

2


Hello, Add the V_DADOSFUNC.AFFILIATE column to a GROUP BY:

GROUP BY V_DADOSFUNC.FILIAL, <<demais colunas>>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.