Postgresql流水帐(第二天): Value Expressions

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)

Column References(列引用)

correlation.columnname     users.username

 

Positional Parameters(位置参数, 同 BASH )

For example, consider the definition of a function, dept, as:

CREATE FUNCTION dept(text) RETURNS dept

AS $$ SELECT * FROM dept WHERE name = $1 $$

LANGUAGE SQL;

$1 表示参数里的第一个参数。

Subscripts, 有点像python 列表切片

expression[subscript]

Operator Invocations

Function Calls

function_name ([expression [, expression ... ]] ) sqrt(2)

 

似懂非懂,不继续流了 J J J

 

 

posted @ 2016-04-08 15:59  songlihong  阅读(154)  评论(0编辑  收藏  举报