Results of 1 - 10 of about 52 for variable (0.003 sec.)
- SET VARIABLE and RESET VARIABLE Statements 15831
- DuckDB supports the definition of SQL-level variables using the SET VARIABLE and RESET VARIABLE statements. Variable Scopes DuckDB supports two levels of variable scopes: Scope Description SESSION Variables with a SESSION scope are local to
...you and only affect the current session. GLOBAL Variables with a GLOBAL scope are specific configuration option variables that affect the entire DuckDB instance and all sessions....For example, see Set a Global Variable . SET VARIABLE The SET VARIABLE statement assigns a value to a variable, which can be accessed using the getvariable call:...SET VARIABLE my_var = 30; SELECT 20 + getvariable('my_var') AS total; total 50 New The $⟨variable⟩ shorthand was introduced in DuckDB 2... - https://man.mtool.work/duckdb/2.0/sql/statements/set_variable.html
- Aggregate Functions 12127
- Examples Produce a single row containing the sum of the amount column: SELECT sum(amount) FROM sales; Produce one row per unique region, containing the sum of amount for each group: SELECT region, sum(amount) FROM sales GROUP BY region; Ret
...FLOAT s, then the result is a LIST of the corresponding discrete quantiles. regr_avgx(y, x) The average of the independent variable for non- NULL pairs, where x is the independent variable and y is the dependent variable. regr_avgy(y, x) The average of t...he dependent variable for non- NULL pairs, where x is the independent variable and y is the dependent variable. regr_count(y, x) The number of n...on- NULL pairs. regr_intercept(y, x) The intercept of the univariate linear regression line, where x is the independent variable and y is the dependent variable. regr_r2(y, x) The squared Pearson correlation coefficient between y and x. Also: The coef... - https://man.mtool.work/duckdb/2.0/sql/functions/aggregates.html
- Prepared Statements 10215
- DuckDB supports prepared statements where parameters are substituted when the query is executed. This can improve readability and is useful for preventing SQL injections . Syntax There are three syntaxes for denoting parameters in prepared
...I client, the statement is executed as follows. EXECUTE query_person(name_start_letter := 'B', minimum_age := 40); Session Variables as Default Values New Using session variables as default values for named parameters was introduced in DuckDB 2.0. When a...named parameter is not supplied at execution time, DuckDB fills it from the session variable of the same name, if one is set. An explicit argument always takes precedence over the variable. SET VARIABLE multiplier =...10; SET VARIABLE x = 42; PREPARE compute AS SELECT $multiplier * $x AS result; With no arguments, both parameters come from the variables,... - https://man.mtool.work/duckdb/2.0/sql/query_syntax/prepared_statements.html
- jemalloc 8363
- On supported platforms, DuckDB replaces the system's memory allocator with jemalloc . jemalloc is statically linked into DuckDB and cannot be installed or loaded during runtime. For technical reasons, we used to distribute jemalloc as an ex
...indows, jemalloc is not available. DuckDB uses the system's memory allocator on these platforms. Configuration Environment Variables The jemalloc allocator in DuckDB can be configured via the DUCKDB_JE_MALLOC_CONF environment variable. Setting this is eq...uivalent to setting the MALLOC_CONF environment variable for jemalloc but DuckDB uses a different environment variable name to avoid potential name clashes with other applications... - https://man.mtool.work/duckdb/2.0/internals/jemalloc.html
- Utility Functions 8035
- 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
...s the data type of the result of the expression as a value of type TYPE . getenv(var) Returns the value of the environment variable var . Only available in the command line client . getvariable('variable_name') Returns the value of the SQL variable named...variable_name , or NULL if it is not set. hash(value) Returns a UBIGINT with a hash of value . The used hash function may change ac.... | | Example | get_type([1, 2]) | | Result | INTEGER[] | getenv(var) | Description | Returns the value of the environment variable var . Only available in the command line client . | | Example | getenv('HOME') | | Result | /path/to/user/home | getvariab... - https://man.mtool.work/duckdb/2.0/sql/functions/utility.html
- Command Line 7990
- Unexpected Markdown Output When Piping If the output of the command line client is piped to another process and an AI agent environment variable (such as AI_AGENT ) is set, the CLI switches to agent mode and prints compact Markdown tables i
...ER | |---| | 42 | To turn off agent mode, use the -no-agent command line argument or set the DUCKDB_AGENT_MODE environment variable to 0 : echo "SELECT 42 AS x;" | duckdb -no-agent | cat ┌───────┐ │ x │ │ int32 │ ├───────┤ │ 42 │ └───────┘ Passing an exp... - https://man.mtool.work/duckdb/2.0/guides/troubleshooting/command_line.html
- Agent Mode 7930
- New Agent mode was introduced in DuckDB 2.0. Agent mode renders the CLI's output for consumption by an AI coding agent rather than a human at a terminal. It produces compact Markdown tables with explicit result limits, machine-readable erro
.... Activating Agent Mode Agent mode is activated automatically when all of the following hold: A known AI agent environment variable (such as AI_AGENT ) is set. The standard output is not a terminal (for example, it is piped to another process). No output...de explicitly: The -agent and -no-agent command line arguments force the mode on or off. The DUCKDB_AGENT_MODE environment variable forces the mode on ( 1 ) or off ( 0 ). The command line flags take precedence over the environment variable. To hide the s... - https://man.mtool.work/duckdb/2.0/clients/cli/agent_mode.html
- Bitstring Type 7766
- Name Aliases Description BITSTRING BIT Variable-length strings of 1s and 0s Bitstrings are strings of 1s and 0s. The bit type data is of variable length. A bitstring value requires 1 byte for each group of 8 bits, plus a fixed amount to sto
... - https://man.mtool.work/duckdb/2.0/sql/data_types/bitstring.html
- UI Extension 7706
- The ui extension adds a user interface for your local DuckDB instance. Usage To start the UI from the command line: duckdb -ui To start the UI from SQL: CALL start_ui(); Running either of these will open the UI in your default browser. The
...ort The local port of the HTTP server can be configured with a SQL command like: SET ui_local_port = 4213; The environment variable ui_local_port can also be used. The default port is 4213. (Why? 4 = D, 21 = U, 3 = C) Remote URL The local HTTP server fet...ternate remote URL can be configured with a SQL command like: SET ui_remote_url = 'https://ui.duckdb.org'; The environment variable ui_remote_url can also be used. This setting is available mainly for testing purposes. Be sure you trust any URL you confi...is short (284 milliseconds). You can configure it with a SQL command like: SET ui_polling_interval = 284; The environment variable ui_polling_interval can also be used. Setting the polling interval to 0 will disable polling entirely. This is not recomme... - https://man.mtool.work/duckdb/2.0/core_extensions/ui.html
- Jupyter Notebooks 7706
- DuckDB's Python client can be used directly in Jupyter notebooks with no additional configuration, as the first section shows. Additional libraries can simplify SQL query development; the rest of this guide uses the JupySQL package. See oth
...on together. Querying in a Python Cell In a plain Python cell, duckdb.sql runs a query and finds a pandas DataFrame by its variable name: import duckdb import pandas as pd sales = pd.DataFrame({"item": ["jeans", "hammer"], "price": [20, 42]}) duckdb.sql(...2.0 with Aggregate Function with name percentile_disc does not exist! . To plot a boxplot, connect via SQLAlchemy. Warning Variables are not recognized within a native DuckDB connection. Connecting to DuckDB via SQLAlchemy Alternatively, you can connect...ELECT schema_name, function_name FROM duckdb_functions() ORDER BY ALL DESC LIMIT 5; To store the query results in a Python variable, use << as an assignment operator. This can be used with both the %sql and %%sql Jupyter magics. %sql res << SELECT 'Off a... - https://man.mtool.work/duckdb/2.0/guides/python/jupyter.html
DuckDB 2.0 Documentation / man.mtool.work