⌘K ctrl+k
Search Shortcut cmd + k | ctrl + k
DuckDB 2.0 ドキュメント 全文検索
per page, with , order by , clip by
Results of 1 - 10 of about 20 for condition (0.004 sec.)
MERGE INTO Statement 13526
The MERGE INTO statement is an alternative to INSERT INTO ... ON CONFLICT that doesn't need a primary key since it allows for a custom match condition. This is a very useful alternative for upserting use cases ( INSERT + UPDATE ) when the d ... o a common pattern to receive a change set with some keys and the changed value. This is a good use for SET . If the match condition uses a column that has the same name in the source and destination, the keyword USING can be used in the match condition. ... THEN DELETE; FROM people ORDER BY id; id name salary 2 Anna 100000.0 3 Sarah 95000.0 MERGE INTO also supports more complex conditions, for example, for a given delete set we can decide to only remove rows that contain a salary bigger or equal than a certa ... DELETE; FROM people ORDER BY id; id name salary 3 Sarah 95000.0 If needed, DuckDB also supports multiple UPDATE and DELETE conditions. The RETURNING clause can be used to indicate which rows were affected by the MERGE statement. -- Let's get John back in! ...
https://man.mtool.work/duckdb/2.0/sql/statements/merge_into.html
Expression API 11300
The Expression class represents an instance of an expression . Why Would I Use the Expression API? Use expressions to build filters and computed columns in Python. They are useful when column names or conditions depend on your code. import ... hould use the helpers: Helper Older constructor col(name) ColumnExpression(name) lit(value) ConstantExpression(value) when(condition).then(value) CaseExpression(condition, value) fn(name, *args) FunctionExpression(name, *args) star(exclude=...) StarExpres ... ─────────┤ │ hello │ │ hello │ │ hello │ │ hello │ └─────────┘ Case Expression This expression is a CASE expression . when(condition).then(value) starts it, each further .when(condition).then(value) adds a branch, tried in order, and .otherwise(value) giv ... edium │ │ 13 │ small │ │ 14 │ small │ └───────┴─────────┘ The older constructor builds the same expression: CaseExpression(condition, value) takes the first branch, .when(condition, value) adds one and .otherwise(value) closes it: from duckdb import CaseE ...
https://man.mtool.work/duckdb/2.0/clients/python/expression.html
FILTER Clause 11164
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 ... t the data into columns rather than re-aggregate it. For list and array_agg , FILTER excludes rows that do not satisfy its condition, whereas a CASE WHEN expression can contribute NULL placeholders for those rows. However, FILTER does not automatically re ... move NULL values from rows that do satisfy the condition. To omit them, include an explicit condition on the aggregated value, such as list(x) FILTER (WHERE x IS NOT NULL) . Examp ... les Filtering NULL Values from Lists A FILTER condition acts on rows, not on the values stored in the resulting list. Here the first expression keeps the NULL value because y is ...
https://man.mtool.work/duckdb/2.0/sql/query_syntax/filter.html
CASE Expression 10519
The CASE expression performs a switch based on a condition. The basic form is identical to the ternary condition used in many programming languages ( CASE WHEN cond THEN a ELSE b END is equivalent to cond ? a : b ). With a single condition ... > 2, 1, 0) AS test FROM integers; The WHEN cond THEN expr part of the CASE expression can be chained, whenever any of the conditions returns true for a single tuple, the corresponding expression is evaluated and returned. CREATE OR REPLACE TABLE integers ... rs; i test 1 10 2 20 3 0 The ELSE clause of the CASE expression is optional. If no ELSE clause is provided and none of the conditions match, the CASE expression will return NULL . CREATE OR REPLACE TABLE integers AS SELECT unnest([1, 2, 3]) AS i; SELECT i ...
https://man.mtool.work/duckdb/2.0/sql/expressions/case.html
Python Client API 8411
Connection class duckdb. Appender Bases: object append_row ( self , * args ) → None Buffer one row, one value per column, each converted as an executemany parameter would be append_rows ( self , rows : object ) → None Buffer each row of an ... t a time rather than the whole result. Detailed examples can be found at Relational API page . join ( other_rel : object , condition : object = None , how : str = 'inner' , suffix : str | None = None ) → DuckDBPyRelation Join the relation object with anot ... her relation object in other_rel. The condition is SQL text, a column name or a list of them for a USING join, an Expression, or a function of the two sides. Types suppor ... me and value name the two new columns. Detailed examples can be found at Relational API page . update ( set : object , * , condition : object = None ) → None Update the given relation with the provided expressions. Detailed examples can be found at Relati ...
https://man.mtool.work/duckdb/2.0/clients/python/reference/
AsOf Join 8411
What is an AsOf Join? Time series data is not always perfectly aligned. Clocks may be slightly off, or there may be a delay between cause and effect. This can make connecting two sets of ordered data challenging. AsOf joins are a tool for s ... 0 23.45 GOOG 2001-01-01 00:01:30 21.16 AsOf Joins with the USING Keyword So far we have been explicit about specifying the conditions for AsOf, but SQL also has a simplified join condition syntax for the common case where the column names are the same in ... lue is the same in both tables. However, for the when column, the values might differ between the two tables due to the >= condition used in the AsOf join. The AsOf join is designed to match each row in the left table ( holdings ) with the nearest precedi ...
https://man.mtool.work/duckdb/2.0/guides/sql_features/asof_join.html
DELETE Statement 8411
The DELETE statement removes rows from the table identified by the table-name. If the WHERE clause is not present, all records in the table are deleted. If a WHERE clause is supplied, then only those rows for which the WHERE clause results ... in true are deleted. Rows for which the expression is false or NULL are retained. Examples Remove the rows matching the condition i = 2 from the database: DELETE FROM tbl WHERE i = 2; Delete all rows in the table tbl : DELETE FROM tbl; USING Clause The ...
https://man.mtool.work/duckdb/2.0/sql/statements/delete.html
FROM and JOIN Clauses 8292
The FROM clause specifies the source of the data on which the remainder of the query should operate. Logically, the FROM clause is where the query starts execution. The FROM clause can contain a single table, a combination of multiple table ... r table are set to NULL . Cross Product Joins (Cartesian Product) The simplest type of join is a CROSS JOIN . There are no conditions for this type of join, and it just returns all the possible pairs. Return all pairs of rows: SELECT a.*, b.* FROM a CROSS ... JOIN b; This is equivalent to omitting the JOIN clause: SELECT a.*, b.* FROM a, b; Conditional Joins Most joins are specified by a predicate that connects attributes from one side to attributes from the other side. ... The conditions can be explicitly specified using an ON clause with the join (clearer) or implied by the WHERE clause (old-fashioned). We ...
https://man.mtool.work/duckdb/2.0/sql/query_syntax/from.html
INSERT Statement 8021
The INSERT statement inserts new data into a table. Examples Insert the values 1, 2, 3 into tbl : INSERT INTO tbl VALUES (1), (2), (3); Insert the result of a query into a table: INSERT INTO tbl SELECT * FROM other_tbl; Insert values into t ... u can provide an additional WHERE clause that can exclude certain rows from the update. The conflicts that don't meet this condition are ignored instead. Because we need a way to refer to both the to-be-inserted tuple and the existing tuple, we introduce ... e further restricted with a WHERE clause, which is checked for each conflicting row. Conflicting rows that do not meet the condition are left unchanged. This WHERE clause is part of the DO UPDATE SET action and must appear after it, as shown below. INSERT ...
https://man.mtool.work/duckdb/2.0/sql/statements/insert.html
Building Extensions 7766
Extensions can be built from source and installed from the resulting local binary. Building Extensions To build using extension flags, set the BUILD_EXTENSIONS flag to the list of extensions that you want to be built. For example: BUILD_EXT ... stributed as such. Enabling this allows TPC-E enabled queries through our test suite. Debug Flags CRASH_ON_ASSERT D_ASSERT(condition) is used all throughout the code, these will throw an InternalException in debug builds. With this flag enabled, when the ...
https://man.mtool.work/duckdb/2.0/dev/building/building_extensions.html
PREV 1 2 NEXT
DuckDB 2.0 Documentation / man.mtool.work