Pergunta de entrevista da empresa Thomson Reuters

In MySQL what is the difference between the WHERE and HAVING clause? They also asked some object orientated related questions, and some trickier logical puzzles.

Resposta da entrevista

Sigiloso

8 de ago. de 2016

1. WHERE clause can be used with - Select, Insert, and Update statements, where as HAVING clause can only be used with the Select statement. 2. WHERE filters rows before aggregation (GROUPING), where as, HAVING filters groups, after the aggregations are performed. 3. Aggregate functions cannot be used in the WHERE clause, unless it is in a sub query contained in a HAVING clause, whereas, aggregate functions can be used in Having clause.

1