SQL HAVING without GROUP BY
SQL HAVING without GROUP BY is a SQL statement in the SELECT Queries category. HAVING can be used without GROUP BY to filter the single aggregated result of the whole table. The syntax is SELECT SUM(col) FROM t HAVING condition;. It returns filtered aggregate result. A close relative is SELECT, which retrieves data from a table. The most fundamental SQL statement. A close relative is SELECT *, which selects all columns from a table. A close relative is SELECT DISTINCT, which returns only distinct (unique) values from the specified columns. More about this category: Core SELECT query clauses — SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT. Related SELECT Queries entries: SELECT, SELECT *, SELECT DISTINCT, WHERE, AND / OR / NOT, IN, BETWEEN, LIKE. This page is part of the free SQL Reference documentation covering 762+ statements, functions, and clauses, each with syntax, parameters, return values, and examples for MySQL, PostgreSQL, SQL Server, and SQLite.