Value Expression

A value expression specifies the value returned by a particular column for each row of the query results.

A value expression can consist of the following items:
  • Column Identifiers
  • Functions
  • Literals (For example, 1234, 'somestring')
  • Expressions (For example, x+y, x AND y)
A value expression can be given a label to use when accessing the data for each column in a row of the query results as shown in the following example:
SELECT col1 AS c1 FROM mytable
If a value expression is not given a label, the entire string used to specify the value expression is used as the label as shown in the following example:
SELECT col1, col2 + col3, ‘row totals’ FROM mytable
To access the columns in the rows of the query result for the SELECT statement above, the following labels would be used:
  • 'col1'
  • 'col2 + col3'
  • 'row totals'
For more information about expressions, see SQL Expressions.