其他分享
首页 > 其他分享> > 4.2. Value Expressions

4.2. Value Expressions

作者:互联网

4.2. Value Expressions

4.2. 值表达式

Value expressions are used in a variety of contexts, such as in the target list of the SELECT command,as new column values in INSERT or UPDATE, or in search conditions in a number of commands. The result of a value expression is sometimes called a scalar, to distinguish it from the result of a table  expression (which is a table). Value expressions are therefore also called scalar expressions (or even simply expressions). The expression syntax allows the calculation of values from primitive parts using arithmetic, logical, set, and other operations.

值表达式可在各种上下文中使用,例如在SELECT命令的目标列表中,作为INSERT或UPDATE中的新值或在许多命令中的搜索条件中使用。 值表达式的结果有时称为标量,以将其与表的表达式(即表)的结果区分开。 因此,值表达式也称为标量表达式(甚至简称为表达式)。 表达式语法允许使用算术,逻辑,集合和其他运算对值进行计算。

 

A value expression is one of the following:

值表达式为以下之一:

• A constant or literal value

• A column reference

• A positional parameter reference, in the body of a function definition or prepared statement

• A subscripted expression

• A field selection expression

• An operator invocation

• A function call

• An aggregate expression

• A window function call

• A type cast

• A collation expression

• A scalar subquery

• An array constructor

• A row constructor

• Another value expression in parentheses (used to group subexpressions and override precedence)

 

In addition to this list, there are a number of constructs that can be classified as an expression but do not follow any general syntax rules. These generally have the semantics of a function or operator and are explained in the appropriate location in Chapter 9. An example is the IS NULL clause.

除此列表外,还有许多可归类为表达式但不遵循任何常规语法规则的构造。 它们通常具有函数或运算符的语义,并在第9章的相应章节中进行了说明。一个示例是IS NULL子句。

 

We have already discussed constants in Section 4.1.2. The following sections discuss the remaining options.

我们在第4.1.2章节讨论了常量。接下来的章节讨论剩余的选项。

 

标签:function,4.2,Value,value,expressions,expression,Expressions,表达式
来源: https://blog.csdn.net/ghostliming/article/details/111352732