⌘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 48 for unique (0.008 sec.)
Constraints 15282
In SQL, constraints can be specified for tables. Constraints enforce certain properties over data that is inserted into a table. Constraints can be specified along with the schema of the table as part of the CREATE TABLE statement . In cert ... NOT NULL); INSERT INTO students VALUES (NULL); Constraint Error: NOT NULL constraint failed: students.name Primary Key and Unique Constraint Primary key or unique constraints define a column, or set of columns, that are a unique identifier for a row in ... the table. The constraint enforces that the specified columns are unique within a table, i.e., that at most one row contains the given values for the set of columns. CREATE TABLE students (id INT ... rimary key constraint To enforce this property efficiently, an ART index is automatically created for every primary key or unique constraint that is defined in the table. Primary key constraints and unique constraints are identical except for two point ...
https://man.mtool.work/duckdb/2.0/sql/constraints.html
ALTER TABLE Statement 11677
The ALTER TABLE statement changes the schema of an existing table in the catalog. Examples CREATE TABLE integers (i INTEGER, j INTEGER); Add a new column with name k to the table integers , it will be filled with the default value NULL : AL ... R TABLE integers RENAME i TO ii; Add a primary key to a column of a table: ALTER TABLE integers ADD PRIMARY KEY (i); Add a unique constraint to a column of a table: ALTER TABLE integers ADD UNIQUE (j); Syntax ALTER TABLE changes the schema of an existi ... e removed if they do not have any indexes that rely on them. This includes any indexes created as part of a PRIMARY KEY or UNIQUE constraint. Columns that are part of multi-column check constraints cannot be dropped either. If you attempt to drop a col ... he index, alter the table, and then recreate the index. Otherwise, you will get a Dependency Error . ADD PRIMARY KEY / ADD UNIQUE The ADD [CONSTRAINT ⟨name⟩] PRIMARY KEY and ADD [CONSTRAINT ⟨name⟩] UNIQUE clauses add a primary key or unique constraint ...
https://man.mtool.work/duckdb/2.0/sql/statements/alter_table.html
Information Schema 10996
The views in the information_schema are SQL-standard views that describe the catalog entries of the database. These views can be filtered to obtain information about a specific column or table. DuckDB's implementation is based on PostgreSQL ... raint is defined on. For a foreign key constraint, this view identifies the columns that the foreign key references. For a unique or primary key constraint, this view identifies the constrained columns. Column Description Type Example table_catalog Nam ... m_id' ordinal_position Ordinal position of the column within the constraint key (count starts at 1). INTEGER 1 position_in_unique_constraint For a foreign-key constraint, ordinal position of the referenced column within its unique constraint (count sta ... he schema containing the constraint. VARCHAR main constraint_name Name of the constraint. VARCHAR exam_id_students_id_fkey unique_constraint_catalog Name of the database that contains the unique or primary key constraint that the foreign key constraint ...
https://man.mtool.work/duckdb/2.0/sql/meta/information_schema.html
CREATE INDEX Statement 8815
CREATE INDEX The CREATE INDEX statement constructs an index on the specified column(s) of the specified table. Examples Create a unique index films_id_idx on the column id of table films : CREATE UNIQUE INDEX films_id_idx ON films (id); Cre ... f the sum of columns j and k from table integers : CREATE INDEX i_index ON integers ((j + k)); Parameters Name Description UNIQUE Causes the system to check for duplicate values in the table when the index is created (if data already exist) and each ti ...
https://man.mtool.work/duckdb/2.0/sql/statements/create_index.html
SELECT Clause 8648
The SELECT clause specifies the list of columns that will be returned by the query. While it appears first in the clause, logically the expressions here are executed only at the end. The SELECT clause can contain arbitrary expressions that ... l2 AS res, sqrt(col1) AS root FROM tbl; Use prefix aliases: SELECT res: col1 + col2, root: sqrt(col1) FROM tbl; Select all unique cities from the addresses table: SELECT DISTINCT city FROM addresses; Return the total number of rows in the addresses tab ... d using regular expressions or lambda functions. See the star expression page for more details. DISTINCT Clause Select all unique cities from the addresses table: SELECT DISTINCT city FROM addresses; The DISTINCT clause can be used to return only the u ... ISTINCT ON(country) city, population FROM cities ORDER BY population DESC; The DISTINCT ON clause returns only one row per unique value in the set of expressions as defined in the ON clause. If an ORDER BY clause is present, the row that is returned is ...
https://man.mtool.work/duckdb/2.0/sql/query_syntax/select.html
DuckDB_% Metadata Functions 8406
DuckDB offers a collection of table functions that provide metadata about the current database. These functions reside in the main schema and their names are prefixed with duckdb_ . The resultset returned by a duckdb_ table function may be ... name) of the table object that defines the column. BIGINT column_name The SQL name of the column. VARCHAR column_index The unique position of the column within its table. INTEGER comment A comment created by the COMMENT ON statement . VARCHAR internal ... INT constraint_type Indicates the type of constraint. Applicable values are CHECK , FOREIGN KEY , PRIMARY KEY , NOT NULL , UNIQUE . VARCHAR constraint_text The definition of the constraint expressed as a SQL-phrase. (Not necessarily a complete or synta ... es the CRS definition. VARCHAR schema_oid Internal identifier of the schema that stores the CRS definition. BIGINT crs_oid Unique internal identifier for the CRS. BIGINT crs_name A unique name that identifies the CRS. (Typically, this value is identica ...
https://man.mtool.work/duckdb/2.0/sql/meta/duckdb_table_functions.html
Full-Text Search 8315
DuckDB supports full-text search via the fts extension . A full-text index allows for a query to quickly search for all occurrences of individual words within longer text strings. Example: Shakespeare Corpus Here's an example of building a ... LL speaker VARCHAR YES NULL NULL NULL text_entry VARCHAR YES NULL NULL NULL The text of each line is in text_entry , and a unique key for each line is in line_id . Creating a Full-Text Search Index First, we create the index, specifying the table name, ... the unique id column, and the column(s) to index. We will just index the single column text_entry , which contains the text of the li ... ext searching from JSON” blog post . The Columns are: line_id , play_name , line_number , speaker , text_entry . We need a unique key for each row in order for full-text searching to work. The line_id KL/2.4.132 means King Lear, Act 2, Scene 4, Line 13 ...
https://man.mtool.work/duckdb/2.0/guides/sql_features/full_text_search.html
Set Operations 8315
Set operations allow queries to be combined according to set operation semantics . Set operations refer to the UNION [ALL] , INTERSECT [ALL] and EXCEPT [ALL] clauses. The vanilla variants use set semantics, i.e., they eliminate duplicates, ... ON (Set Semantics) The vanilla UNION clause follows set semantics, therefore it performs duplicate elimination, i.e., only unique rows will be included in the result. SELECT * FROM range(2) t1(x) UNION SELECT * FROM range(3) t2(x); x 2 1 0 UNION ALL (B ... in the result of both queries. Vanilla INTERSECT (Set Semantics) Vanilla INTERSECT performs duplicate elimination, so only unique rows are returned. SELECT * FROM range(2) t1(x) INTERSECT SELECT * FROM range(6) t2(x); x 0 1 INTERSECT ALL (Bag Semantics ... Vanilla EXCEPT (Set Semantics) Vanilla EXCEPT follows set semantics, therefore, it performs duplicate elimination, so only unique rows are returned. SELECT * FROM range(5) t1(x) EXCEPT SELECT * FROM range(2) t2(x); x 2 3 4 EXCEPT ALL (Bag Semantics) EX ...
https://man.mtool.work/duckdb/2.0/sql/query_syntax/setops.html
Appender 7982
The Appender can be used to load bulk data into a DuckDB database. It is available in the C, C++, Go, Java, Julia, Node.js, Python, and Rust clients. This page describes how the Appender behaves across clients and shows a minimal example in ... ollection discards any remaining buffered rows. See the Python Appender . Constraints such as NOT NULL , PRIMARY KEY , and UNIQUE are checked when the cache is flushed rather than as each row is added, so a row can be accepted but later fail at flush t ... N TRANSACTION and COMMIT statements. Handling Constraint Violations If the Appender encounters a PRIMARY KEY conflict or a UNIQUE constraint violation, it fails and returns the following error: Constraint Error: PRIMARY KEY or UNIQUE constraint violate ...
https://man.mtool.work/duckdb/2.0/data/appender.html
List Functions 7891
Function Description list[index] Extracts a single list element using a (1-based) index . list[begin[:end][:step]] Extracts a sublist using slice conventions . Negative values are accepted. list1 && list2 Alias for list_has_any . list1 <-> ... Concatenates list/array elements with a comma delimiter. array_transform(list, lambda(x)) Alias for list_transform . array_unique(list) Alias for list_unique . array_where(value_list, mask_list) Alias for list_where . array_zip(list_1, ..., list_n[, tr ... the input list . The return type is defined by the return type of the lambda function. See list_transform examples . list_unique(list) Counts the unique elements of a list . list_value(arg, ...) Creates a LIST containing the argument values. list_var_ ... 1, 2, 3], lambda x : x + 1) | | Result | [2, 3, 4] | | Aliases | apply , array_apply , array_transform , list_apply | list_unique(list) | Description | Counts the unique elements of a list . | | Example | list_unique([1, 1, NULL, -3, 1, 5]) | | Result ...
https://man.mtool.work/duckdb/2.0/sql/functions/list.html
PREV 1 2 3 4 5 NEXT
DuckDB 2.0 Documentation / man.mtool.work