4.4.14 Relation reference

Organization of this subsection
(1) Format
(2) Function
(3) Operands
(4) Syntax rules
(5) Notes
(6) Usage example

(1) Format

relation-reference::={relation-name
                  |stream-name'['window-specification']'}
                  [[Figure]AS[Figure]alias]

(2) Function

Specifies the relation to be searched. The relation to be referenced is specified using the FROM clause.

(3) Operands

relation-name

Specifies the name of the relation to be searched.

For the relation name, you can specify a query name that was returned without converting the inquiry result into a stream using a stream clause.

stream-name

Specifies the name of the stream to be searched.

For the stream name, you can specify a query name that was returned by turning the inquiry result into a stream using a stream clause.

window-specification

For details about window specification, see 4.4.15 Window specification.

alias

Specify an alias if the name of the relation being referenced is long and complex. The alias name must follow the standard naming rules. For details about the naming rules, see 3.2.4 Specifying names.

An alias name must be unique in any given SELECT clause. Also, you cannot specify a name that is the same as another table ID. For details about table IDs, see 3.2.5 Name qualification.

(4) Syntax rules

(5) Notes

None.

(6) Usage example

Outputs the data in columns a and b of relation s1. The underlined part indicates a relation reference.

REGISTER QUERY q1 SELECT s1.a, s1.b FROM s1[ROWS 100];