⌘K ctrl+k
Search Shortcut cmd + k | ctrl + k
DuckDB 2.0 ドキュメント 全文検索
per page, with , order by , clip by
Results of 1 - 2 of about 2 for dept (0.001 sec.)
UNPIVOT Statement 11228
The UNPIVOT statement allows multiple columns to be stacked into fewer columns. In the basic case, multiple columns are stacked into two columns: a NAME column (which contains the name of the source column) and a VALUE column (which contain ... ple Data All examples use the dataset produced by the queries below: CREATE OR REPLACE TABLE monthly_sales (empid INTEGER, dept TEXT, Jan INTEGER, Feb INTEGER, Mar INTEGER, Apr INTEGER, May INTEGER, Jun INTEGER); INSERT INTO monthly_sales VALUES (1, ... 3, 4, 5, 6), (2, 'clothes', 10, 20, 30, 40, 50, 60), (3, 'cars', 100, 200, 300, 400, 500, 600); FROM monthly_sales; empid dept Jan Feb Mar Apr May Jun 1 electronics 1 2 3 4 5 6 2 clothes 10 20 30 40 50 60 3 cars 100 200 300 400 500 600 UNPIVOT Manua ... month column and a sales column. UNPIVOT monthly_sales ON jan, feb, mar, apr, may, jun INTO NAME month VALUE sales; empid dept month sales 1 electronics Jan 1 1 electronics Feb 2 1 electronics Mar 3 1 electronics Apr 4 1 electronics May 5 1 electron ...
https://man.mtool.work/duckdb/2.0/sql/statements/unpivot.html
Pivot Internals 7485
PIVOT Pivoting is implemented as a combination of SQL query re-writing and a dedicated PhysicalPivot operator for higher performance. Each PIVOT is implemented as set of aggregations into lists and then the dedicated PhysicalPivot operator ... mple: UNPIVOT monthly_sales ON jan, feb, mar, apr, may, jun INTO NAME month VALUE sales; is translated into: SELECT empid, dept, unnest(['jan', 'feb', 'mar', 'apr', 'may', 'jun']) AS month, unnest(["jan", "feb", "mar", "apr", "may", "jun"]) AS sales ... the double quotes to pull the column values for use in sales . This produces the same result as the initial example: empid dept month sales 1 electronics jan 1 1 electronics feb 2 1 electronics mar 3 1 electronics apr 4 1 electronics may 5 1 electron ...
https://man.mtool.work/duckdb/2.0/internals/pivot.html
PREV 1 NEXT
DuckDB 2.0 Documentation / man.mtool.work