Results of 1 - 10 of about 50 for exists (0.001 sec.)
- Subqueries 13610
- Subqueries are parenthesized query expressions that appear as part of a larger, outer query. Subqueries are usually based on SELECT ... FROM , but in DuckDB other query constructs such as PIVOT can also appear as a subquery. Scalar Subquery
...he subquery is less than or equal to 5. The quantifier SOME may be used instead of ANY : ANY and SOME are interchangeable. EXISTS The EXISTS operator tests for the existence of any row inside the subquery. It returns either true when the subquery retur...ns one or more records, and false otherwise. The EXISTS operator is generally the most useful as a correlated subquery to express semijoin operations. However, it can be used as...ated subquery as well. For example, we can use it to figure out if there are any grades present for a given course: SELECT EXISTS (FROM grades WHERE course = 'Math') AS math_grades_present; math_grades_present true SELECT EXISTS (FROM grades WHERE cour... - https://man.mtool.work/duckdb/2.0/sql/expressions/subqueries.html
- TPC-H Extension 12302
- The tpch extension implements the data generator and queries for the TPC-H benchmark . Installing and Loading The tpch extension is shipped by default in some DuckDB builds, otherwise it will be transparently autoloaded on first use. If you
...does not clean up existing TPC-H tables. To clean up existing tables, use DROP TABLE before running dbgen : DROP TABLE IF EXISTS customer; DROP TABLE IF EXISTS lineitem; DROP TABLE IF EXISTS nation; DROP TABLE IF EXISTS orders; DROP TABLE IF EXISTS pa...rt; DROP TABLE IF EXISTS partsupp; DROP TABLE IF EXISTS region; DROP TABLE IF EXISTS supplier; Running a Query To run a query, e.g., query 4, use:... - https://man.mtool.work/duckdb/2.0/core_extensions/tpch.html
- CREATE TRIGGER Statement 11640
- New The CREATE TRIGGER feature was introduced in DuckDB 2.0. The CREATE TRIGGER statement registers a trigger: a set of SQL statements that run automatically in response to INSERT , UPDATE , or DELETE events on a table. Examples Record ever
...STATEMENT INSERT INTO price_changes DEFAULT VALUES; Drop a trigger: DROP TRIGGER trg_audit ON target; Drop a trigger if it exists: DROP TRIGGER IF EXISTS trg_audit ON target; Syntax The triggered statement is a single SQL statement, typically a data mo...UPDATE . OLD TABLE contains the deleted or pre-update rows and is available for UPDATE and DELETE . OR REPLACE and IF NOT EXISTS CREATE OR REPLACE TRIGGER replaces an existing trigger with the same name. CREATE TRIGGER IF NOT EXISTS does nothing if a...trigger with the same name already exists on the table. Without either clause, creating a trigger with a name that already exists results in an error. The two claus... - https://man.mtool.work/duckdb/2.0/sql/statements/create_trigger.html
- CREATE INDEX Statement 9595
- 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
...revenue of table films : CREATE INDEX s_idx ON films (revenue); Create index if it does not yet exist: CREATE INDEX IF NOT EXISTS s_idx ON films (revenue); The CREATE INDEX IF NOT EXISTS statement does not have an “early exit” at the moment, instead, i...only check its existence before committing it to storage. Therefore, it may run for a longer time compared to other IF NOT EXISTS statements, which terminate early. Create compound index gy_idx on genre and year columns: CREATE INDEX gy_idx ON films (g...index from the database system. Examples Remove the index title_idx : DROP INDEX title_idx; Parameters Name Description IF EXISTS Do not throw an error if the index does not exist. name The name of an index to remove. Syntax Limitations The CREATE INDE... - https://man.mtool.work/duckdb/2.0/sql/statements/create_index.html
- Variant Functions 8948
- This section describes functions that operate on the VARIANT type . New Most variant_* functions were introduced in DuckDB 2.0. The variant_extract , variant_normalize and variant_typeof functions were already available in DuckDB 1.5. Name
...d) Extract a nested value as a VARCHAR . variant_array_length(v) Return the number of elements in a VARIANT array. variant_exists(v, key) Return whether the given key exists in a VARIANT object. variant_contains(haystack, needle) Return whether the nee...er of elements in a VARIANT array. | | Example | variant_array_length('[1, 2, 3]'::JSON::VARIANT) | | Result | 3 | variant_exists(v, key) | Description | Return whether the given key exists in a VARIANT object. | | Example | variant_exists('{"a": 1}'::... - https://man.mtool.work/duckdb/2.0/sql/functions/variant.html
- CREATE SEQUENCE Statement 8858
- The CREATE SEQUENCE statement creates a new sequence number generator. Examples Generate an ascending sequence starting from 1: CREATE SEQUENCE serial; Generate sequence from a given start number: CREATE SEQUENCE serial START 101; Generate
...catalog items. Overwrite an existing sequence: CREATE OR REPLACE SEQUENCE serial; Only create sequence if no such sequence exists yet: CREATE SEQUENCE IF NOT EXISTS serial; Remove sequence: DROP SEQUENCE serial; Remove sequence if exists: DROP SEQUENCE...IF EXISTS serial; Using Sequences for Primary Keys Sequences can be used as DEFAULT values in CREATE TABLE statements . The example...ssion exit. Existing permanent sequences with the same name are not visible (in this session) while the temporary sequence exists, unless they are referenced with schema-qualified names. Sequences are based on BIGINT arithmetic, so the range cannot exc... - https://man.mtool.work/duckdb/2.0/sql/statements/create_sequence.html
- ALTER DATABASE Statement 8617
- Warning The ALTER DATABASE statement is not supported in DuckDB 2.0.0: ALTER DATABASE ⟨old_name⟩ RENAME TO ⟨new_name⟩ fails with Parser Error: syntax error at or near "RENAME" . To rename an attached database, DETACH it and ATTACH it again
...d in memory. Rename a database from old_name to new_name : ALTER DATABASE old_name RENAME TO new_name; Check if a database exists and rename it: ALTER DATABASE IF EXISTS non_existent RENAME TO something_else;... - https://man.mtool.work/duckdb/2.0/sql/statements/alter_database.html
- CREATE TABLE Statement 8542
- The CREATE TABLE statement creates a table in the catalog. Examples Create a table with two integer columns ( i and j ): CREATE TABLE t1 (i INTEGER, j INTEGER); Create a table with a primary key: CREATE TABLE t1 (id INTEGER PRIMARY KEY, j V
...ing the existing table and then creating the new one. Create a table with two integer columns (i and j) even if t1 already exists: CREATE OR REPLACE TABLE t1 (i INTEGER, j INTEGER); IF NOT EXISTS The IF NOT EXISTS syntax will only proceed with the crea...tion of the table if it does not already exist. If the table already exists, no action will be taken and the existing table will remain in the database. Create a table with two integer columns ( i a...nd j ) only if t1 does not exist yet: CREATE TABLE IF NOT EXISTS t1 (i INTEGER, j INTEGER); CREATE TABLE ... AS SELECT (CTAS) DuckDB supports the CREATE TABLE ... AS SELECT syntax, also k... - https://man.mtool.work/duckdb/2.0/sql/statements/create_table.html
- CREATE SCHEMA Statement 8452
- The CREATE SCHEMA statement creates a schema in the catalog. The default schema is main . Examples Create a schema: CREATE SCHEMA s1; Create a schema if it does not exist yet: CREATE SCHEMA IF NOT EXISTS s2; Create a schema or replace a sch
...ema if it exists: CREATE OR REPLACE SCHEMA s2; Create table in the schemas: CREATE TABLE s1.t (id INTEGER PRIMARY KEY, other_id INTEGER); C... - https://man.mtool.work/duckdb/2.0/sql/statements/create_schema.html
- CREATE MACRO Statement 8377
- The CREATE MACRO statement defines a named, callable SQL expression as a database schema object. Macros may declare parameters, which can be referenced by its expression. Once a macro is created, it may be called by referencing its name and
...s an alias for CREATE MACRO . The simplified syntax for creating a macro is: CREATE [OR REPLACE] [TEMPORARY] MACRO [IF NOT EXISTS] ⟨identifier⟩( [⟨parameters⟩] ) AS [TABLE] ⟨expression⟩; The identifier consists of the macro's name, which can be any val...ame name (within the schema) to be overwritten. Without OR REPLACE such an attempt will fail with a Macro Function already exists error. An IF NOT EXISTS clause may occur immediately before the identifier, and has the effect of only creating the macro...if it does not already exist. Either the OR REPLACE or the IF NOT EXISTS clause may be present, but not both. The macro name is followed by parentheses. If the macro has parameters , then they mu... - https://man.mtool.work/duckdb/2.0/sql/statements/create_macro.html
DuckDB 2.0 Documentation / man.mtool.work