Results of 1 - 3 of about 3 for income (0.001 sec.)
- HAVING Clause 11812
- The HAVING clause can be used after the GROUP BY clause to provide filter criteria after the grouping has been completed. In terms of syntax the HAVING clause is identical to the WHERE clause, but while the WHERE clause occurs before the gr
...ities with a count below 50: SELECT city, count(*) FROM addresses GROUP BY city HAVING count(*) >= 50; Compute the average income per city per street_name , filtering out cities with an average income bigger than twice the median income : SELECT city,...street_name, avg(income) FROM addresses GROUP BY city, street_name HAVING avg(income) > 2 * median(income); Syntax... - https://man.mtool.work/duckdb/2.0/sql/query_syntax/having.html
- GROUP BY Clause 8668
- The GROUP BY clause specifies which grouping columns should be used to perform any aggregations in the SELECT clause. If the GROUP BY clause is specified, the query is always an aggregate query, even if no aggregations are present in the SE
...ddresses table that belong to each different city: SELECT city, count(*) FROM addresses GROUP BY city; Compute the average income per city per street_name : SELECT city, street_name, avg(income) FROM addresses GROUP BY city, street_name; GROUP BY ALL E...and street_name to remove any duplicate values: SELECT city, street_name FROM addresses GROUP BY ALL; Compute the average income per city per street_name. Since income is wrapped in an aggregate function, do not include it in the GROUP BY : SELECT cit...y, street_name, avg(income) FROM addresses GROUP BY ALL; -- GROUP BY city, street_name: Syntax... - https://man.mtool.work/duckdb/2.0/sql/query_syntax/groupby.html
- GROUPING SETS 7403
- GROUPING SETS , ROLLUP and CUBE can be used in the GROUP BY clause to perform a grouping over multiple dimensions within the same query. Note that this syntax is not compatible with GROUP BY ALL . Examples Compute the average income along t
...dimensions: -- the syntax () denotes the empty set (i.e., computing an ungrouped aggregate) SELECT city, street_name, avg(income) FROM addresses GROUP BY GROUPING SETS ((city, street_name), (city), (street_name), ()); Compute the average income along...the same dimensions: SELECT city, street_name, avg(income) FROM addresses GROUP BY CUBE (city, street_name); Compute the average income along the dimensions (city, street_name) , (...city) and () : SELECT city, street_name, avg(income) FROM addresses GROUP BY ROLLUP (city, street_name); Description GROUPING SETS performs the same aggregate across differen... - https://man.mtool.work/duckdb/2.0/sql/query_syntax/grouping_sets.html
PREV
1
NEXT
DuckDB 2.0 Documentation / man.mtool.work