Results of 1 - 3 of about 3 for street (0.001 sec.)
- GROUP BY Clause 11924
- 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
...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 Examples Group by cit...y 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 city, street_name, avg(... - https://man.mtool.work/duckdb/2.0/sql/query_syntax/groupby.html
- GROUPING SETS 8092
- 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
...ed four different 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 aver...age 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); Descript... - https://man.mtool.work/duckdb/2.0/sql/query_syntax/grouping_sets.html
- HAVING Clause 7868
- 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
...elow 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(inc...ome) 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
PREV
1
NEXT
DuckDB 2.0 Documentation / man.mtool.work