⌘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 37 for else (0.002 sec.)
Map Functions 13039
Name Description cardinality(map) Return the size of the map (or the number of entries in the map). element_at(map, key) Return the value for a given key as a list, or an empty list if the key is not contained in the map. The type of the ke ... y provided in the second parameter must match the type of the map's keys; else, an error is thrown. map_concat(maps...) Returns a map created from merging the input maps . On key collision the value is ... y is not contained in the map. The type of the key provided in the second parameter must match the type of the map's keys; else, an error is thrown. map_extract_value(map, key) Returns the value for a given key or NULL if the key is not contained in ... the map. The type of the key provided in the second parameter must match the type of the map's keys; else, an error is thrown. map_from_entries(STRUCT(k, v)[]) Returns a map created from the entries of the array. map_keys(map) R ...
https://man.mtool.work/duckdb/2.0/sql/functions/map.html
CASE Expression 12897
The CASE expression performs a switch based on a condition. The basic form is identical to the ternary condition used in many programming languages ( CASE WHEN cond THEN a ELSE b END is equivalent to cond ? a : b ). With a single condition ... with IF(cond, a, b) . CREATE OR REPLACE TABLE integers AS SELECT unnest([1, 2, 3]) AS i; SELECT i, CASE WHEN i > 2 THEN 1 ELSE 0 END AS test FROM integers; i test 1 0 2 0 3 1 This is equivalent to: SELECT i, IF(i > 2, 1, 0) AS test FROM integers; Th ... d. CREATE OR REPLACE TABLE integers AS SELECT unnest([1, 2, 3]) AS i; SELECT i, CASE WHEN i = 1 THEN 10 WHEN i = 2 THEN 20 ELSE 0 END AS test FROM integers; i test 1 10 2 20 3 0 The ELSE clause of the CASE expression is optional. If no ELSE clause is ...
https://man.mtool.work/duckdb/2.0/sql/expressions/case.html
Vectors 11255
Vectors represent a horizontal slice of a column. They hold a number of values of a specific type, similar to an array. Vectors are the core data representation used in DuckDB. Vectors are typically stored within data chunks . The vector an ... uckdb_open(nullptr, &db); duckdb_connect(db, &con); duckdb_result res; duckdb_query(con, "SELECT CASE WHEN i%2=0 THEN NULL ELSE i END res_col FROM range(10) t(i)", &res); // iterate until result is exhausted while (true) { duckdb_data_chunk result = ... row < row_count; row++) { if (duckdb_validity_row_is_valid(vector_validity, row)) { printf("%lld\n", vector_data[row]); } else { printf("NULL\n"); } } duckdb_destroy_data_chunk(&result); } // clean-up duckdb_destroy_result(&res); duckdb_disconnect(& ... ptr, &db); duckdb_connect(db, &con); duckdb_result res; duckdb_query(con, "SELECT CASE WHEN i%2=0 THEN CONCAT('short_', i) ELSE CONCAT('longstringprefix', i) END FROM range(10) t(i)", &res); // iterate until result is exhausted while (true) { duckdb_ ...
https://man.mtool.work/duckdb/2.0/clients/c/vector.html
Timestamp with Time Zone Functions 9345
This section describes functions and operators for examining and manipulating TIMESTAMP WITH TIME ZONE (or TIMESTAMPTZ ) values . See also the related TIMESTAMP functions . Time zone support is provided by the built-in ICU extension . In th ... h . The grid is anchored at 2000-01-01 00:00:00+00:00[ + offset] when bucket_width is a number of months or coarser units, else 2000-01-03 00:00:00+00:00[ + offset] . Note that 2000-01-03 is a Monday. time_bucket(bucket_width, timestamptz[, origin]) ... he origin timestamp, which defaults to 2000-01-01 00:00:00+00:00 when bucket_width is a number of months or coarser units, else 2000-01-03 00:00:00+00:00 . Note that 2000-01-03 is a Monday. time_bucket(bucket_width, timestamptz[, timezone]) Truncate ... , which defaults to 2000-01-01 00:00:00 in the provided timezone when bucket_width is a number of months or coarser units, else 2000-01-03 00:00:00 in the provided timezone . The default timezone is 'UTC' . Note that 2000-01-03 is a Monday. age(times ...
https://man.mtool.work/duckdb/2.0/sql/functions/timestamptz.html
Date Functions 9219
This section describes functions and operators for examining and manipulating DATE values. Date Operators The table below shows the available mathematical operators for DATE types. Operator Description Example Result + addition of days (int ... dth bucket_width . The grid is anchored at 2000-01-01[ + offset] when bucket_width is a number of months or coarser units, else 2000-01-03[ + offset] . Note that 2000-01-03 is a Monday. time_bucket(bucket_width, date[, origin]) Truncate timestamptz t ... s anchored at the origin timestamp, which defaults to 2000-01-01 when bucket_width is a number of months or coarser units, else 2000-01-03 . Note that 2000-01-03 is a Monday. today() Current date (start of current transaction) in the local time zone. ... dth bucket_width . The grid is anchored at 2000-01-01[ + offset] when bucket_width is a number of months or coarser units, else 2000-01-03[ + offset] . Note that 2000-01-03 is a Monday. | | Example | time_bucket(INTERVAL '2 months', DATE '1992-04-20' ...
https://man.mtool.work/duckdb/2.0/sql/functions/date.html
C++ API 9076
Installation To use the DuckDB C++ API, download the libduckdb archive for your platform. The latest stable version of the DuckDB C++ API is 2.0.0. Warning DuckDB's C++ API is internal. It is not guaranteed to be stable and can change witho ... ULL)"); auto result = con.Query("SELECT * FROM integers"); if (result->HasError()) { cerr << result->GetError() << endl; } else { cout << result->ToString() << endl; } Query will not throw exceptions under normal circumstances. Instead, invalid queri ... Object(); errorObject.ConvertErrorToJSON(); std::cout << errorObject.Message() << std::endl; break; } // More handling } } else { // Normal code } If successful, other fields are set: the type of statement that was just executed (e.g., StatementType: ... Value : auto result = con.Query("SELECT * FROM integers"); if (result->HasError()) { cerr << result->GetError() << endl; } else { // Print the column names as a header row for (idx_t col_idx = 0; col_idx < result->ColumnCount(); col_idx++) { cout << ...
https://man.mtool.work/duckdb/2.0/clients/cpp.html
Utility Functions 9076
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 ... ng as a UBIGINT . nextval('sequence_name') Return the following value of the sequence. nullif(a, b) Return NULL if a = b , else return a . Equivalent to CASE WHEN a = b THEN NULL ELSE a END . parse_formatted_bytes(string) Parse a human-readable byte ... _sort_key('ö', 'DE') | | Result | 470145960106 | if(a, b, c) | Description | Ternary conditional operator; returns b if a, else returns c. Equivalent to CASE WHEN a THEN b ELSE c END . | | Example | if(2 > 1, 3, 4) | | Result | 3 | ifnull(expr, other ... he sequence. | | Example | nextval('my_sequence_name') | | Result | 2 | nullif(a, b) | Description | Return NULL if a = b, else return a. Equivalent to CASE WHEN a = b THEN NULL ELSE a END . | | Example | nullif(1+1, 2) | | Result | NULL | parse_form ...
https://man.mtool.work/duckdb/2.0/sql/functions/utility.html
Information Schema 9076
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 ... of the database encoding. VARCHAR 'UTF8' character_repertoire Character repertoire, showing UCS if the encoding is UTF8 , else just the encoding name. VARCHAR 'UCS' form_of_use Character encoding form, same as the database encoding. VARCHAR 'UTF8' d ... the table is a typed table, the name of the database that contains the underlying data type (always the current database), else NULL . Currently unimplemented. VARCHAR NULL user_defined_type_schema If the table is a typed table, the name of the schem ... a that contains the underlying data type, else NULL . Currently unimplemented. VARCHAR NULL user_defined_type_name If the table is a typed table, the name of the underly ...
https://man.mtool.work/duckdb/2.0/sql/meta/information_schema.html
Timestamp Functions 8524
This section describes functions and operators for examining and manipulating TIMESTAMP values . See also the related TIMESTAMPTZ functions . Timestamp Operators The table below shows the available mathematical operators for TIMESTAMP types ... t_width . The grid is anchored at 2000-01-01 00:00:00[ + offset] when bucket_width is a number of months or coarser units, else 2000-01-03 00:00:00[ + offset] . Note that 2000-01-03 is a Monday. time_bucket(bucket_width, timestamp[, origin]) Truncate ... d at the origin timestamp, which defaults to 2000-01-01 00:00:00 when bucket_width is a number of months or coarser units, else 2000-01-03 00:00:00 . Note that 2000-01-03 is a Monday. try_strptime(text, format-list) Converts the string text to timest ... bucket_width . The grid includes 2000-01-01 00:00:00[ + offset] when bucket_width is a number of months or coarser units, else 2000-01-03 00:00:00[ + offset] . Note that 2000-01-03 is a Monday. | | Example | time_bucket(INTERVAL '10 minutes', TIMEST ...
https://man.mtool.work/duckdb/2.0/sql/functions/timestamp.html
ALTER DATABASE Statement 8256
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 ... me 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
PREV 1 2 3 4 NEXT
DuckDB 2.0 Documentation / man.mtool.work