⌘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 159 for Integer (0.002 sec.)
Interval Functions 10338
This section describes functions and operators for examining and manipulating INTERVAL values. Interval Operators The table below shows the available mathematical operators for INTERVAL types. Operator Description Example Result + Addition ... l) Normalizes an interval so that units that overflow their range are carried over into the next larger unit. to_centuries(integer) Construct a century interval. to_days(integer) Construct a day interval. to_decades(integer) Construct a decade interval. ... to_hours(integer) Construct an hour interval. to_microseconds(integer) Construct a microsecond interval. to_millennia(integer) Construct a ... millennium interval. to_milliseconds(integer) Construct a millisecond interval. to_minutes(integer) Construct a minute interval. to_months(integer) Construct a month i ...
https://man.mtool.work/duckdb/2.0/sql/functions/interval.html
CREATE TABLE Statement 10062
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 ... ARCHAR); Create a table with a composite primary key: CREATE TABLE t1 (id INTEGER, j VARCHAR, PRIMARY KEY (id, j)); Create a table with various different types, constraints and default values: CREATE TABL ... E t1 ( i INTEGER NOT NULL DEFAULT 0, decimalnr DOUBLE CHECK (decimalnr < 10), date DATE UNIQUE, time TIMESTAMP ); Create table with CREATE ... by the new table. This is shorthand for dropping 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 E ...
https://man.mtool.work/duckdb/2.0/sql/statements/create_table.html
Literal Types 9947
DuckDB has special literal types for representing NULL , integer and string literals in queries. These have their own binding and conversion rules. Prior to DuckDB version 0.10.0, integer and string literals behaved identically to the INTEGER ... terals The NULL literal is denoted with the keyword NULL . The NULL literal can be implicitly converted to any other type. Integer Literals Integer literals are denoted as a sequence of one or more decimal digits. At runtime, these result in values of t ... he INTEGER_LITERAL type. INTEGER_LITERAL types can be implicitly converted to any integer type in which the value fits. For example, ... the integer literal 42 can be implicitly converted to a TINYINT , but the integer literal 1000 cannot be. DuckDB does not support hexa ...
https://man.mtool.work/duckdb/2.0/sql/data_types/literal_types.html
Data Types 9786
General-Purpose Data Types The table below shows all the built-in general-purpose data types. The alternatives listed in the aliases column can be used to refer to these types as well, however, note that the aliases are not part of the SQL ... d and hence might not be accepted by other database engines. Name Aliases Description BIGINT INT8 , LONG Signed eight-byte integer BIT BITSTRING String of 1s and 0s BLOB BYTEA , BINARY , VARBINARY Variable-length binary data BIGNUM Variable-length integ ... ecision floating-point number (4 bytes) GEOMETRY Geospatial entity, see the GEOMETRY data type HUGEINT Signed sixteen-byte integer INTEGER INT4 , INT , SIGNED Signed four-byte integer INTERVAL Date / time delta JSON JSON object (via the json extension ) ... SMALLINT INT2 , SHORT Signed two-byte integer TIME Time of day (no time zone) TIMESTAMP WITH TIME ZONE TIMESTAMPTZ Combination of time and date that uses the current ti ...
https://man.mtool.work/duckdb/2.0/sql/data_types/overview.html
INSERT Statement 9786
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 ... his is the default option, that can be explicitly specified using the BY POSITION option. For example: CREATE TABLE tbl (a INTEGER, b INTEGER); INSERT INTO tbl VALUES (5, 42); Specifying BY POSITION is optional and is equivalent to the default behavior: ... ES (5, 42); To use a different order, column names can be provided as part of the target, for example: CREATE TABLE tbl (a INTEGER, b INTEGER); INSERT INTO tbl (b, a) VALUES (5, 42); Adding BY POSITION results in the same behavior: INSERT INTO tbl BY PO ... fers from the order of the values in the SELECT statement or certain columns are missing. For example: CREATE TABLE tbl (a INTEGER, b INTEGER); INSERT INTO tbl BY NAME (SELECT 42 AS b, 32 AS a); INSERT INTO tbl BY NAME (SELECT 22 AS b); SELECT * FROM tb ...
https://man.mtool.work/duckdb/2.0/sql/statements/insert.html
Types API 9199
The DuckDBPyType class, duckdb.sqltypes.DuckDBPyType , represents one of the data types . Use DuckDBPyType to describe SQL types when declaring function parameters, return types or casts. Python types such as int are accepted too: int descr ... Exception . Type DuckDB type numpy.bool_ BOOLEAN numpy.float32 FLOAT numpy.float64 DOUBLE numpy.int16 SMALLINT numpy.int32 INTEGER numpy.int64 BIGINT numpy.int8 TINYINT numpy.uint16 USMALLINT numpy.uint32 UINTEGER numpy.uint64 UBIGINT numpy.uint8 UTINYI ... NT Type Names A string is read as a SQL type name, such as "INTEGER" , "INT[]" , "STRUCT(a INT)" or "MAP(INT, VARCHAR)" : import duckdb from duckdb.sqltypes import DuckDBPyType print(DuckDBP ... yType("MAP(INT, VARCHAR)")) MAP(INTEGER, VARCHAR) A type created with CREATE TYPE exists only in its database, so name the connection: DuckDBPyType("mood", connec ...
https://man.mtool.work/duckdb/2.0/clients/python/types.html
Typecasting 8774
Typecasting is an operation that converts a value in one particular data type to the closest corresponding value in another data type. Like other SQL engines, DuckDB supports both implicit and explicit typecasting. Explicit Casting Explicit ... pe combinations, and is generally only possible when the cast cannot fail. For example, an implicit cast can be added from INTEGER to DOUBLE – but not from DOUBLE to INTEGER . Consider the function sin(DOUBLE) . This function takes as input argument a c ... olumn of type DOUBLE , however, it can be called with an integer as well: sin(1) . The integer is converted into a double before being passed to the sin function. Tip To check whether a t ... here the conversion is generally lossless, so they are also safe to reverse, with the notable exception of casts from wide integer or DECIMAL types to FLOAT or DOUBLE , which can lose precision. Explicit-only casts may lose information or fail for parti ...
https://man.mtool.work/duckdb/2.0/sql/data_types/typecasting.html
Struct Data Type 8544
Conceptually, a STRUCT column contains an ordered list of columns called “entries”. The entries are referenced by name using strings. This document refers to those entry names as keys. Each row in the STRUCT column must have the same keys. ... AS s; Create a struct using a row variable: SELECT d AS s FROM (SELECT 'value1' AS key1, 42 AS key2) d; Create a struct of integers: SELECT {'x': 1, 'y': 2, 'z': 3} AS s; Create a struct of strings with a NULL value: SELECT {'yes': 'duck', 'maybe': 'goo ... eses: SELECT row(x, x + 1, y) AS t FROM (SELECT 1 AS x, 'a' AS y) AS s; ┌──────────────────────────────────┐ │ t │ │ tuple(integer, integer, varchar) │ ├──────────────────────────────────┤ │ (1, 2, a) │ └──────────────────────────────────┘ If using mult ... ng comma, (x,) . The type of a tuple is written as TUPLE(⟨type_1⟩, ..., ⟨type_n⟩) : SELECT typeof((1, 'a')) AS type; TUPLE(INTEGER, VARCHAR) Accessing Tuple Entries Tuple entries are accessed by position using the bracket notation or the struct_extract ...
https://man.mtool.work/duckdb/2.0/sql/data_types/struct.html
Constraints 8233
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 ... que within a table, i.e., that at most one row contains the given values for the set of columns. CREATE TABLE students (id INTEGER PRIMARY KEY, name VARCHAR); INSERT INTO students VALUES (1, 'Student 1'); INSERT INTO students VALUES (1, 'Student 2'); Co ... nstraint Error: Duplicate key "id: 1" violates primary key constraint CREATE TABLE students (id INTEGER, name VARCHAR, PRIMARY KEY (id, name)); INSERT INTO students VALUES (1, 'Student 1'); INSERT INTO students VALUES (1, 'Stu ... ed, but many unique constraints A primary key constraint also enforces the keys to not be NULL . CREATE TABLE students (id INTEGER PRIMARY KEY, name VARCHAR, email VARCHAR UNIQUE); INSERT INTO students VALUES (1, 'Student 1', 'student1@uni.com'); INSERT ...
https://man.mtool.work/duckdb/2.0/sql/constraints.html
Numeric Types 8072
Fixed-Width Integer Types The types TINYINT , SMALLINT , INTEGER , BIGINT and HUGEINT store whole numbers, that is, numbers without fractional components, of various ranges. Attempts to store values outside of the allowed range will result ... in an error. The types UTINYINT , USMALLINT , UINTEGER , UBIGINT and UHUGEINT store whole unsigned numbers. Attempts to store negative numbers or values outside of the allowed r ... an error. Name Aliases Min Max Size in bytes TINYINT INT1 - 2^7 2^7 - 1 1 SMALLINT INT2 , INT16 , SHORT - 2^15 2^15 - 1 2 INTEGER INT4 , INT32 , INT , SIGNED - 2^31 2^31 - 1 4 BIGINT INT8 , INT64 , LONG - 2^63 2^63 - 1 8 HUGEINT INT128 - 2^127 2^127 - ... 1 16 UTINYINT UINT8 0 2^8 - 1 1 USMALLINT UINT16 0 2^16 - 1 2 UINTEGER UINT32 0 2^32 - 1 4 UBIGINT UINT64 0 2^64 - 1 8 UHUGEINT UINT128 0 2^128 - 1 16 INT8 is a 64-bit integer, and is not the s ...
https://man.mtool.work/duckdb/2.0/sql/data_types/numeric.html
PREV 1 2 3 4 5 6 7 8 9 10 NEXT
DuckDB 2.0 Documentation / man.mtool.work