Results of 1 - 10 of about 50 for expressions (0.002 sec.)
- SELECT Clause 13836
- The SELECT clause specifies the list of columns that will be returned by the query. While it appears first in the clause, logically the expressions here are executed only at the end. The SELECT clause can contain arbitrary expressions that
...ters, use double quotes ( " ): SELECT "Some Column Name" FROM tbl; Syntax SELECT List The SELECT clause contains a list of expressions that specify the result of a query. The select list can refer to any columns in the FROM clause, and combine them using ex...pressions. As the output of a SQL query is a table – every expression in the SELECT clause also has a name. The expressions can be explicitly named using the AS clause (e.g., expr AS name ). If a name is not provided by the user the expressions a...automatically by the system. Column names are case-insensitive. See the Rules for Case Sensitivity for more details. Star Expressions Select all columns from the table called tbl : SELECT * FROM tbl; Select all columns matching the given regular expression... - https://man.mtool.work/duckdb/2.0/sql/query_syntax/select.html
- PIVOT Statement 11700
- The PIVOT statement allows distinct values within a column to be separated into their own columns. The values within those new columns are calculated using an aggregate function on the subset of rows that match each distinct value. DuckDB i
...ities ON year IN (2000, 2010) USING sum(population) GROUP BY country; country 2000 2010 NL 1005 1065 US 8579 8783 Multiple Expressions per Clause Multiple columns can be specified in the ON and GROUP BY clauses, and multiple aggregate expressions can be inc...luded in the USING clause. Multiple ON Columns and ON Expressions Multiple columns can be pivoted out into their own columns. DuckDB will find the distinct values in each ON clause column...ivot only the combinations of values that are present in the underlying data, use an expression in the ON clause. Multiple expressions and/or columns may be provided. Here, country and name are concatenated together and the resulting concatenations each rec... - https://man.mtool.work/duckdb/2.0/sql/statements/pivot.html
- Star Expression 10978
- Syntax The * expression can be used in a SELECT statement to select all columns that are projected in the FROM clause. SELECT * FROM tbl; TABLE.* and STRUCT.* The * expression can be prepended by a table name to select only columns from tha
...me query. sql SELECT * EXCEPT (col) FROM tbl; REPLACE Clause REPLACE allows you to replace specific columns by alternative expressions. SELECT * REPLACE (col1 / 1_000 AS col1, col2 / 1_000 AS col2) FROM tbl; RENAME Clause RENAME allows you to replace specif...EPLACE (number + id AS number))), count(COLUMNS(* EXCLUDE (number))) FROM numbers; id min((number + id)) id 1 11 3 COLUMNS expressions can also be combined, as long as they contain the same star expression: SELECT COLUMNS(*) + COLUMNS(*) FROM numbers; id nu...mber 2 20 4 40 6 NULL COLUMNS Expression in a WHERE Clause COLUMNS expressions can also be used in WHERE clauses. The conditions are applied to all columns and are combined using the logical AND operat... - https://man.mtool.work/duckdb/2.0/sql/expressions/star.html
- Friendly SQL 9294
- DuckDB offers several advanced SQL features and syntactic sugar to make SQL queries more concise. We refer to these colloquially as “friendly SQL”. Several of these features were first introduced by DuckDB, while some are inspired by other
...ific columns from the * expression. SELECT * REPLACE : the REPLACE option allows replacing specific columns with different expressions in a * expression. UNION BY NAME : perform the UNION operation along the names of columns (instead of relying on positions...lause of JOIN clauses .) COLUMNS() expression can be used to execute the same expression on multiple columns: with regular expressions with EXCLUDE and REPLACE with lambda functions Reusable column aliases (also known as “lateral column aliases”), e.g.: SEL...P BY ROLLUP clauses count() shorthand for count(*) IN operator for lists and maps Specifying column names for common table expressions ( WITH ) Data-modifying CTEs : use INSERT , UPDATE , DELETE and COPY statements in common table expressions Specifying col... - https://man.mtool.work/duckdb/2.0/sql/dialect/friendly_sql.html
- Expressions 9204
- An expression is a combination of values, operators and functions. Expressions are highly composable, and range from very simple to arbitrarily complex. They can be found in many different parts of SQL statements. This section describes the
...different types of operators and functions that can be used within expressions.... - https://man.mtool.work/duckdb/2.0/sql/expressions/overview.html
- Pattern Matching 8753
- There are four separate approaches to pattern matching provided by DuckDB: the traditional SQL LIKE operator , the more recent SIMILAR TO operator (added in SQL:1999), a GLOB operator , and POSIX-style regular expressions . LIKE The LIKE ex
...'A%c' ILIKE 'a$%c' ESCAPE '$'; -- true There are also alternative characters that can be used as keywords in place of LIKE expressions. These enhance PostgreSQL compatibility. PostgreSQL-style LIKE -style ~~ LIKE !~~ NOT LIKE ~~* ILIKE !~~* NOT ILIKE SIMILA...acters match string characters exactly unless they are special characters in the regular expression language — but regular expressions use different special characters than LIKE does. Some examples: SELECT 'abc' SIMILAR TO 'abc'; -- true SELECT 'abc' SIMILA...irectory, the following query returns both files: SELECT * FROM glob('**/README.md'); file README.md sub/README.md Regular Expressions DuckDB's regular expression support is documented on the Regular Expressions page . DuckDB supports some PostgreSQL-style... - https://man.mtool.work/duckdb/2.0/sql/functions/pattern_matching.html
- ORDER BY Clause 8753
- ORDER BY is an output modifier. Logically it is applied near the very end of the query (just prior to LIMIT or OFFSET , if present). The ORDER BY clause sorts the rows on the sorting criteria in either ascending or descending order. In addi
...an specify whether NULL values should be moved to the beginning or to the end. The ORDER BY clause may contain one or more expressions, separated by commas. An error will be thrown if no expressions are included, since the ORDER BY clause should be removed...in that situation. The expressions may begin with either an arbitrary scalar expression (which could be a column name), a column position number (where the i...BY ALL ASC or ORDER BY ALL DESC and/or NULLS FIRST or NULLS LAST . Note that ALL may not be used in combination with other expressions in the ORDER BY clause – it must be by itself. See examples below. NULL Order Modifier By default, DuckDB sorts ASC and NU... - https://man.mtool.work/duckdb/2.0/sql/query_syntax/orderby.html
- INSERT Statement 8662
- 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
...O tbl (i) VALUES (1); Syntax INSERT INTO inserts new rows into a table. One can insert one or more rows specified by value expressions, or zero or more rows resulting from a query. Insert Column Order It's possible to provide an optional insert column order...E Clause (Upsert) The DO UPDATE clause causes the INSERT to turn into an UPDATE on the conflicting row(s) instead. The SET expressions that follow determine how these rows are updated. The expressions can use the special virtual table EXCLUDED , which conta...ted tuple, otherwise, it refers to the existing tuple. This special qualifier can be used within the WHERE clauses and SET expressions of the ON CONFLICT clause. CREATE TABLE tbl (i INTEGER PRIMARY KEY, j INTEGER); INSERT INTO tbl VALUES (1, 42); INSERT INT... - https://man.mtool.work/duckdb/2.0/sql/statements/insert.html
- GROUPING SETS 8482
- GROUPING SETS , ROLLUP and CUBE can be used in the GROUP BY clause to perform a grouping over multiple dimensions within the same query. Note that this syntax is not compatible with GROUP BY ALL . Examples Compute the average income along t
...hich groups generated the super-aggregate rows in the result. GROUPING_ID() is an aggregate function that takes the column expressions that make up the grouping(s). It returns a BIGINT value. The return value is 0 for the rows that are not super-aggregate r...ows. But for the super-aggregate rows, it returns an integer value that identifies the combination of expressions that make up the group for which the super-aggregate is generated. At this point, an example might help. Consider the foll...0 000 2023 4 11 0 000 2023 4 12 0 000 2023 4 NULL 1 001 2023 NULL NULL 3 011 NULL NULL NULL 7 111 Note that the number of expressions passed to GROUPING_ID() , or the order in which they are passed is independent from the actual group definitions appearing... - https://man.mtool.work/duckdb/2.0/sql/query_syntax/grouping_sets.html
- Struct Data Type 8392
- 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.
...also be used. Note that this uses single quotes ( ' ) since the goal is to specify a certain string key and only constant expressions may be used inside the brackets (no expressions): SELECT a['x space'] FROM (SELECT {'x space': 1, 'y': 2, 'z': 3} AS a); T...y': 2, 'z': 3} AS a); x z 1 3 Warning The star notation is currently limited to top-level struct columns and non-aggregate expressions. Dot Notation Order of Operations Referring to structs with dot notation can be ambiguous with referring to schemas and ta...ntries are referenced by their (1-based) position. Tuples are created using the row function or, if there are at least two expressions, using parentheses: SELECT row(x, x + 1, y) AS t FROM (SELECT 1 AS x, 'a' AS y) AS s; ┌──────────────────────────────────┐... - https://man.mtool.work/duckdb/2.0/sql/data_types/struct.html
DuckDB 2.0 Documentation / man.mtool.work