relation-reference::={relation-name
|stream-name'['window-specification']'}
[AS
alias]
Specifies the relation to be searched. The relation to be referenced is specified using the FROM clause.
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.
REGISTER QUERY q1 SELECT a1.c1, a2.c1 FROM s1[NOW] AS a1, s2[NOW] AS a2
WHERE a1.c1 > 1 GROUP BY a1.c1, a2.c1
HAVING a2.c1 > 1;
REGISTER QUERY q1 SELECT a1.c1, a2.c1 FROM s1[NOW] AS a1, s2[NOW] AS a2;
REGISTER QUERY q2 SELECT a1.c1, a2.c1 FROM q1 WHERE a1.c1 > 1
GROUP BY a1.c1, a2.c1 HAVING a2.c1 > 1;
REGISTER STREAM s1 (id INT, name VARCHAR(10));
REGISTER STREAM s2 (id INT, name VARCHAR(10));
REGISTER QUERY q1 SELECT * FROM s1[NOW] AS s2;
REGISTER QUERY q1 SELECT * FROM s1[NOW];
REGISTER QUERY q2 SELECT * FROM s2[NOW] AS q1;
REGISTER QUERY q1 ISTREAM(
SELECT ... FROM s1[RANGE 5] AS old, s1[NOW] AS new ...);
REGISTER QUERY q1 ISTREAM(
SELECT ... FROM s1[RANGE 5], s1[NOW] ...);
None.
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];