An EQL query contains one or more semicolon-delimited statements.
Any number of statements from the query can return results, while others are defined only as generating intermediate results.
Each statement must contain at least two clauses: a DEFINE or a RETURN clause, and a SELECT clause. In addition, it may contain other, optional clauses.
Most clauses can contain expressions. Expressions are typically combinations of one or more functions, attributes, constants, or operators. Most expressions are simple combinations of functions and attributes. EQL provides functions for working with numeric, string, dateTime, duration, Boolean, and geocode attribute types.
Input records, output records, and records used in aggregation can be filtered in EQL. EQL supports filtering on arbitrary, Boolean expressions.
Several of the examples in this section are based on sales data from a fictitious bicycle seller. The schema used matches the schema used in the Quick Start application, a reference implementation of Oracle Endeca Information Discovery. You can use these examples in the Quick Start application to begin experimenting with EQL.
The syntax descriptions in this section use the following conventions:
Convention | Meaning | Example |
---|---|---|
Square brackets [ ] | Optional |
FROM <statementKey> [alias] |
Asterisk * | May be repeated |
[, JOIN statement [alias] ON <Boolean expression>]* |
Ellipsis ... | Additional, unspecified content |
DEFINE <recordSetName> AS ... |
Angle brackets < > | Variable name |
HAVING <Boolean expression> |
You can comment your EQL code using the following notation:
DEFINE Example AS SELECT /* This is a comment */
You can also comment out lines or sections as shown in the following example:
RETURN Top5 AS SELECT SUM(Sale) AS Sales GROUP BY Customer ORDER BY Sales DESC PAGE(0,5); /* RETURN Others AS SELECT SUM(Sale) AS Sales WHERE NOT [Customer] IN Top5 GROUP */ ...