HAVING clause (Item) without grouping or aggregation.

Error 3091

You tried to execute an SQL statement29F05E5 that contains a HAVING Clause (SQL)2HNJY0 but doesn't contain a GROUP BY Clause (SQL)61THXA8 or an aggregate function1ZORO0I in the SELECT Statement (SQL)ZUPF0W.  For example, this error occurs if you execute this SQL statement:

 

          SELECT [Last Name]
          FROM Employees
          HAVING [Last Name] > "M";

 

If you don't want to perform grouping or include an aggregate function, you can apply the same condition by entering a WHERE Clause (SQL)4DMR9SH.  The next example shows how you might enter the preceding SQL statement correctly.

 

          SELECT [Last Name]
          FROM Employees
          WHERE [Last Name] > "M";

 

See Also

Using SQL (Structured Query Language)2WCWZZP