K
K
Kirkl2014-12-06 15:00:44
SQL
Kirkl, 2014-12-06 15:00:44

Is it possible to use having before group by in sql queries?

And if so, what is the difference in the output if we use having first and then group by between using group by first and then having.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2014-12-06
@Rsa97

I can't speak for all SQL dialects, but MySQL only allows HAVING after GROUP BY. WHERE is used before GROUP BY.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question