⌘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 33 for world (0.002 sec.)
Regular Expressions 15385
DuckDB offers pattern matching operators ( LIKE , SIMILAR TO , GLOB ), as well as support for regular expressions via functions. Regular Expression Syntax DuckDB uses the RE2 library as its regular expression engine. For the regular express ... gex . Splits the string along the regex . A set of optional options can be set. | | Example | regexp_split_to_array('hello world; 42', ';? ') | | Result | ['hello', 'world', '42'] | regexp_split_to_table(string, regex[, options]) | Description | Split ... he regex and returns a row for each part. A set of optional options can be set. | | Example | regexp_split_to_table('hello world; 42', ';? ') | | Result | Three rows: 'hello' , 'world' , '42' | The regexp_matches function is similar to the SIMILAR TO ... _matches('abcd', 'ABC', 'i'); -- true SELECT regexp_matches('ab^/$cd', '^/$', 'l'); -- true SELECT regexp_matches(E'hello\nworld', 'hello.world', 'p'); -- false SELECT regexp_matches(E'hello\nworld', 'hello.world', 's'); -- true Using regexp_matches T ...
https://man.mtool.work/duckdb/2.0/sql/functions/regular_expressions.html
Literal Types 10764
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 INTEG ... literals separated only by whitespace that contains at least one newline are implicitly concatenated: SELECT 'Hello' ' ' 'World' AS greeting; is equivalent to: SELECT 'Hello' || ' ' || 'World' AS greeting; They both return the following result: greet ... ing Hello World Note that implicit concatenation only works if there is at least one newline between the literals. Using adjacent string l ... iterals separated by whitespace without a newline results in a syntax error: SELECT 'Hello' ' ' 'World' AS greeting; Parser Error: syntax error at or near "' '" LINE 1: SELECT 'Hello' ' ' 'World' AS greeting; ^ Also note that ...
https://man.mtool.work/duckdb/2.0/sql/data_types/literal_types.html
Text Functions 9802
Text Functions and Operators This section describes functions and operators for examining and manipulating STRING values . Function Description string[index] Extracts a single character using a (1-based) index . string[begin:end] Extracts a ... catenates multiple strings or lists. NULL inputs are skipped. See also operator || . | | Example 1 | concat('Hello', ' ', 'World') | | Result | Hello World | | Example 2 | concat([1, 2, 3], NULL, [4, 5, 6]) | | Result | [1, 2, 3, 4, 5, 6] | concat_ws( ... escription | Splits the string along the regex and returns a row for each part. | | Example | regexp_split_to_table('hello world; 42', ';? ') | | Result | Multiple rows: 'hello' , 'world' , '42' | repeat(string, count) | Description | Repeats the stri ... string_split(string, separator) | Description | Splits the string along the separator . | | Example | string_split('hello-world', '-') | | Result | [hello, world] | | Aliases | split , str_split , string_to_array | string_split_regex(string, regex[, ...
https://man.mtool.work/duckdb/2.0/sql/functions/text.html
Importing Duckbox Tables 9256
The scripts provided in this page work on Linux, macOS, and WSL. By default, the DuckDB CLI client renders query results in the duckbox format , which uses rich, ASCII-art inspired tables to show data. These tables are often shared verbatim ... he DuckDB 1.2.0 release blog post : ┌─────────┬───────┐ │ a │ b │ │ varchar │ int64 │ ├─────────┼───────┤ │ hello │ 42 │ │ world │ 84 │ └─────────┴───────┘ What if we would like to load this data back to DuckDB? This is not supported by default but it ... │ *//;s/ *│$//;s/ *│ */│/g" duckbox.csv >> duckbox-cleaned.csv The duckbox-cleaned.csv file looks as follows: a│b hello│42 world│84 We can then simply load this to DuckDB via: FROM read_csv('duckbox-cleaned.csv', delim = '│'); And export it to a CSV: ... COPY (FROM read_csv('duckbox-cleaned.csv', delim = '│')) TO 'out.csv'; a,b hello,42 world,84 Using shellfs To parse duckbox tables with a single read_csv call – and without creating any temporary files –, we can ...
https://man.mtool.work/duckdb/2.0/guides/snippets/importing_duckbox_tables.html
Variant Type 9256
The VARIANT type stores typed, binary data where each row is self-contained with its own type information. This differs from the JSON type , which is physically stored as text. Because type metadata is embedded per-value, VARIANT provides b ... types across rows: CREATE TABLE events (id INTEGER, data VARIANT); INSERT INTO events VALUES (1, 42::VARIANT), (2, 'hello world'::VARIANT), (3, [1, 2, 3]::VARIANT), (4, {'name': 'Alice', 'age': 30}::VARIANT); SELECT * FROM events; ┌───────┬────────── ... ──────────────────┐ │ id │ data │ │ int32 │ variant │ ├───────┼────────────────────────────┤ │ 1 │ 42 │ │ 2 │ hello world │ │ 3 │ [1, 2, 3] │ │ 4 │ {'age': 30, 'name': Alice} │ └───────┴────────────────────────────┘ Note that the keys of VARIAN ... │ │ int32 │ variant │ varchar │ ├───────┼────────────────────────────┼───────────────────┤ │ 1 │ 42 │ INT32 │ │ 2 │ hello world │ VARCHAR │ │ 3 │ [1, 2, 3] │ ARRAY(3) │ │ 4 │ {'age': 30, 'name': Alice} │ OBJECT(age, name) │ └───────┴───────────────── ...
https://man.mtool.work/duckdb/2.0/sql/data_types/variant.html
CREATE SEQUENCE Statement 8615
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 ... EATE TABLE tbl (id INTEGER PRIMARY KEY DEFAULT nextval('id_sequence'), s VARCHAR); INSERT INTO tbl (s) VALUES ('hello'), ('world'); SELECT * FROM tbl; The script results in the following table: id s 1 hello 2 world Sequences can also be added using th ... lumn and fills it with values generated by the sequence: CREATE TABLE tbl (s VARCHAR); INSERT INTO tbl VALUES ('hello'), ('world'); CREATE SEQUENCE id_sequence START 1; ALTER TABLE tbl ADD COLUMN id INTEGER DEFAULT nextval('id_sequence'); SELECT * FRO ...
https://man.mtool.work/duckdb/2.0/sql/statements/create_sequence.html
Functions 8502
Function Syntax Function Chaining via the Dot Operator DuckDB supports the dot syntax for function chaining. This allows the function call fn(arg1, arg2, arg3, ...) to be rewritten as arg1.fn(arg2, arg3, ...) . For example, take the followi ... Literals and Arrays String literals and array access operations can be used with function chaining directly: SELECT 'hello world'.replace(' ', '_'); SELECT m[1].map_entries() FROM (VALUES ([MAP {'hello': 42}, MAP {'world': 42}])) t(m); To apply functi ...
https://man.mtool.work/duckdb/2.0/sql/functions/overview.html
Casting 8406
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 ... acro adds to a number if the input is an INTEGER : CREATE TABLE tbl (i INT, s VARCHAR); INSERT INTO tbl VALUES (42, 'hello world'); CREATE MACRO conditional_add(col, nr) AS CASE WHEN typeof(col) == 'INTEGER' THEN cast_to_type(col::INTEGER + nr, col) E ... add(COLUMNS(*), 100) FROM tbl; ┌───────┬─────────────┐ │ i │ s │ │ int32 │ varchar │ ├───────┼─────────────┤ │ 142 │ hello world │ └───────┴─────────────┘ Note that the CASE statement needs to return the same type in all code paths. We can perform the ...
https://man.mtool.work/duckdb/2.0/sql/expressions/cast.html
Directly Reading Files 8294
DuckDB allows directly reading files via the read_text and read_blob functions. These functions accept a filename, a list of filenames, or a glob pattern. They output the content of each file as a VARCHAR or BLOB , respectively, along with ... t/sql/table_function/files/*.txt'); size parse_path(filename) content 12 [test, sql, table_function, files, one.txt] Hello World! 2 [test, sql, table_function, files, three.txt] 42 10 [test, sql, table_function, files, two.txt] Foo Bar\nFöö Bär DuckDB ... filename 178 PK\x03\x04\x0A\x00\x00\x00\x00\x00\xACi=X\x14t\xCE\xC7\x0A… test/sql/table_function/files/four.blob 12 Hello World! test/sql/table_function/files/one.txt 2 42 test/sql/table_function/files/three.txt 10 F\xC3\xB6\xC3\xB6 B\xC3\xA4r test/s ...
https://man.mtool.work/duckdb/2.0/guides/file_formats/read_file.html
Command Line Arguments 8085
The table below summarizes DuckDB's command line options. To list all command line options, use the command: duckdb -help For a list of dot commands available in the CLI shell, see the Dot Commands page . Argument Description -agent Render ... rder, similarly to the behavior of the SQLite CLI. For example: duckdb -csv -c 'SELECT 42 AS hello' -json -c 'SELECT 84 AS world' Returns the following: hello 42 [{"world":84}] The -init script (or the default ~/.duckdbrc when -init is not given) is a ...
https://man.mtool.work/duckdb/2.0/clients/cli/arguments.html
PREV 1 2 3 4 NEXT
DuckDB 2.0 Documentation / man.mtool.work