LucidDbSelectExpression

From Eigenpedia

Jump to: navigation, search

Syntax

select-expression ::=
SELECT [ DISTINCT | ALL ] select-item, ...
FROM from-list
[ WHERE predicate-expression ]
[ GROUP BY { value-expression, ... | () } ]
[ HAVING predicate-expression ]
select-item ::= select-expression [ [ AS ] column-alias ]
select-expression ::= 
[ table-or-alias-name . ] *
| value-expression
from-list ::=
aliased-table-ref [ join-expression ... ]
join-expression ::= implicit-join | explicit-join
implicit-join ::= , aliased-table-ref
explicit-join ::= explicit-join-type JOIN aliased-table-ref [ ON predicate-expression | USING ( column-name, ... ) ]
explicit-join-type ::=
[ INNER ]
| LEFT [ OUTER ]
| RIGHT [ OUTER ]
| FULL [ OUTER ]
| CROSS
aliased-table-ref ::= table-ref [ [ AS ] table-alias ] [ TABLESAMPLE tablesample-expression ]
table-ref ::= 
qualified-table-name
| ( query-expression )
| TABLE ( udx-invocation )
udx-invocation ::=
[ SPECIFIC ] qualified-udx-name ( [ udx-argument, ... ] )
udx-argument ::= value-expression | CURSOR ( query-statement ) | ROW (column-reference, ...)
tablesample-expression ::= subst-expression | sample-expression
subst-expression ::= SUBSTITUTE ( character-value-expression )
sample-expression ::= 
BERNOULLI | SYSTEM
( numeric-literal )
[ REPEATABLE ( numeric-literal ) ]

See LucidDbValueExpression for specification of value-expression, predicate-expression, character-value-expression, and numeric-literal.

See LucidDbQueryStatement for specification of query-expression and query-statement.

Example

SELECT DISTINCT ename, job
FROM timesheet_fact t, employee_dimension e, calendar_dimension c
WHERE t.emp_key=e.emp_key
AND t.workday_key=c.calendar_key
AND c.is_weekend;
Personal tools