Results of 1 - 10 of about 14 for casts (0.002 sec.)
- Typecasting 14004
- 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
...e column col to VARCHAR . See the cast page for more information. Implicit Casting In many situations, the system will add casts by itself. This is called implicit casting and happens, for example, when a function is called with an argument that does...not match the type of the function but can be cast to the required type. Implicit casts can only be added for a number of type combinations, and is generally only possible when the cast cannot fail. For example...g When values of different types need to be combined to an unspecified joint parent type, the system will perform implicit casts to an automatically selected parent type. For example, list_value(1::INT64, 1::UINT64) creates a list of type INT128[] . T... - https://man.mtool.work/duckdb/2.0/sql/data_types/typecasting.html
- Union Type 11185
- A UNION type (not to be confused with the SQL UNION operator ) is a nested type capable of holding one of multiple “alternative” values, much like the union in C. The main difference is that these UNION types are tagged unions and thus alwa
...three Select the currently active tag from the UNION as an ENUM . SELECT union_tag(u) AS t FROM tbl1; t num str str Union Casts Compared to other nested types, UNION s allow a set of implicit casts to facilitate unintrusive and natural usage when wor...king with their members as “subtypes”. However, these casts have been designed with two principles in mind, to avoid ambiguity and to avoid casts that could lead to loss of informati...exception to this is when casting a UNION to VARCHAR , in which case the members will all use their corresponding VARCHAR casts. Since everything can be cast to VARCHAR , this is “safe” in a sense. Casting to Unions A type can always be implicitly ca... - https://man.mtool.work/duckdb/2.0/sql/data_types/union.html
- Comparisons 9260
- Comparison Operators The table below shows the standard comparison operators. Whenever either of the input arguments is NULL , the output of the comparison is NULL . Operator Description Example Result < less than 2 < 3 true > greater than
...M NULL true Combination Casting When performing comparison on different types, DuckDB performs Combination Casting . These casts were introduced to make interactive querying more convenient and are in line with the casts performed by several programmi... - https://man.mtool.work/duckdb/2.0/sql/expressions/comparison_operators.html
- Casting 9155
- Casting refers to the operation of converting a value in a particular data type to the corresponding value in another data type. Casting can occur either implicitly or explicitly. The syntax described here performs an explicit cast. More in
..._series(1, 3) tbl(i); i 1 2 3 SELECT i::DOUBLE AS i FROM generate_series(1, 3) tbl(i); i 1.0 2.0 3.0 Casting Rules Not all casts are possible. For example, it is not possible to convert an INTEGER to a DATE . Casts may also throw errors when the cast... - https://man.mtool.work/duckdb/2.0/sql/expressions/cast.html
- Timestamp Issues 8927
- Timestamp with Time Zone Promotion Casts Working with time zones in SQL can be quite confusing at times. For example, when filtering to a date range, one might try the following query: SET timezone = 'America/Los_Angeles'; CREATE TABLE time
...row table against any timestamp column to quickly obtain the temporal bin values for the time zone in question. The inner casts are not required, but result in a smaller table because date_part returns 64 bit integers for all parts. Notice that we ca... - https://man.mtool.work/duckdb/2.0/guides/sql_features/timestamps.html
- Set Operations 8034
- 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,
...and require the to-be-combined queries to have the same number of input columns. If the columns are not of the same type, casts may be added. The result will use the column names from the first query. DuckDB also supports UNION [ALL] BY NAME , which... - https://man.mtool.work/duckdb/2.0/sql/query_syntax/setops.html
- Types API 7912
- 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
... - https://man.mtool.work/duckdb/2.0/clients/python/types.html
- Utility Functions 7912
- Scalar Utility Functions The functions below are difficult to categorize into specific function types and are broadly useful. Name Description alias(column) Return the name of the column. can_cast_implicitly(source_value, target_value) Whet
...use read_blob instead. See the read_text guide for more details. replace_type(value, source_type, target_type) Recursively casts every field of value that has type source_type to target_type . The types are supplied as NULL -typed values, e.g., NULL::...| read_text('hello.txt') | | Result | hello\n | replace_type(value, source_type, target_type) | Description | Recursively casts every field of value that has type source_type to target_type . The source and target types are supplied as NULL -typed va... - https://man.mtool.work/duckdb/2.0/sql/functions/utility.html
- COPY Statement 7912
- Examples Read a CSV file into the lineitem table, using auto-detected CSV options: COPY lineitem FROM 'lineitem.csv'; Read a CSV file into the lineitem table, using manually specified CSV options: COPY lineitem FROM 'lineitem.csv' (DELIMITE
...use gzip , file.blob.zst will use zstd , and file.blob will use none ). Options are none , gzip , zstd . VARCHAR auto Type casts the string value foo to the BLOB data type and outputs the results to blob_output.blob : COPY (select 'foo'::BLOB) TO 'blo...b_output.blob' (FORMAT BLOB); Type casts the string value foo to the BLOB data type and outputs the results to blob_output_gzip.blob.gz with gzip compression: COPY... - https://man.mtool.work/duckdb/2.0/sql/statements/copy.html
- Numeric Types 7684
- 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
...OUBLE FLOAT8 Double precision floating-point number (8 bytes) Like for fixed-point data types, conversion from literals or casts from other datatypes to floating-point types stores inputs that cannot be represented exactly as approximations. However,... - https://man.mtool.work/duckdb/2.0/sql/data_types/numeric.html
DuckDB 2.0 Documentation / man.mtool.work