⌘K ctrl+k
Search Shortcut cmd + k | ctrl + k
DuckDB 2.0 ドキュメント 全文検索
per page, with , order by , clip by
Results of 1 - 1 of about 1 for five (0.000 sec.)
FILTER Clause 9414
The FILTER clause may optionally follow an aggregate function in a SELECT statement. This will filter the rows of data that are fed into the aggregate function in the same way that a WHERE clause filters rows, but localized to the specific ... number of rows where i <= 5 The number of rows where i is odd SELECT count() AS total_rows, count() FILTER (i <= 5) AS lte_five, count() FILTER (i % 2 = 1) AS odds FROM generate_series(1, 10) tbl(i); total_rows lte_five odds 10 5 5 Simply counting ro ... t aggregate functions may be used, and multiple WHERE expressions are also permitted: SELECT sum(i) FILTER (i <= 5) AS lte_five_sum, median(i) FILTER (i % 2 = 1) AS odds_median, median(i) FILTER (i % 2 = 1 AND i <= 5) AS odds_lte_five_median FROM gen ... erate_series(1, 10) tbl(i); lte_five_sum odds_median odds_lte_five_median 15 5.0 3.0 The FILTER clause can also be used to pivot data from rows into columns. T ...
https://man.mtool.work/duckdb/2.0/sql/query_syntax/filter.html
PREV 1 NEXT
DuckDB 2.0 Documentation / man.mtool.work