SELECT Syntax Supported in Hyperstage

Topics:

The following SELECT syntax is supported in Hyperstage.

SELECT Syntax

For more information, see the PostgreSQL 9.2 Documentation.

SELECT [ALL|DISTINCT|DISTINCTROW]
SELECT_expr, …
[FROM table_references[WHERE where_condition]
[GROUP BY {col_name|expr|position}]
[HAVING where_condition]
[ORDER BY {col_name|expr|position} [ASC|DESC ], …]
[LIMIT {[offset,] row_count|row_count OFFSET offset} ]
[INTO OUTFILE 'file_name' export_options- AS alias_name- ORDER BY NULL]

JOIN Syntax

For more information, see the PostgreSQL 9.2 Documentation.

Hyperstage supports the following JOIN syntax for the table_references part of SELECT statements (as described in SELECT Syntax).

table_references: table_reference [, table_references]
table_reference: table_factor | join_table
  
table_factor:
tbl_name [[AS] alias]
  
join_table:
table_reference [INNER|CROSS] JOIN table_factor [join_condition]
| table_reference STRAIGHT_JOIN table_factor
| table_reference STRAIGHT_JOIN table_factor ON condition
| table_reference {LEFT|RIGHT} [OUTER] JOIN table_reference join_condition
  
join_condition:
ON conditional_expr | USING (column_list)

Union Syntax

For more information, see the PostgreSQL 9.2 Documentation.

SELECT ….
UNION [ALL|DISTINCT] SELECT …
[UNION [ALL|DISTINCT] SELECT … ]

Subqueries

For more information, see the PostgreSQL 9.2 Documentation.

SELECT * FROM t1 WHERE column1 = (SELECT max(column1) FROM t2);

The following functions are also supported:

  • Subquery as scalar operand
  • Subquery with ANY, IN, SOME, and ALL
  • EXISTS and NOT EXISTS
  • Correlated subqueries
  • Subqueries in the FROM clause
  • VIEWs in the FROM clause

WebFOCUS

Feedback