Rules for using EQL to define a view

The view definition EQL defines the content of the view. When defining a view, you need to keep the following restrictions in mind.

While the definition may contain multiple DEFINE and SELECT statements, the last statement must be a DEFINE statement that lists all of the view attributes.

The statement should include at least one grouping attribute.

Also, when defining a view:

Also note that because EQL does not support multi-assign, any multi-assign attribute that you add to a view will not be multi-assign in the context of the view. For additional information on using EQL, including the limitations on multi-assign, see the Oracle Endeca Server EQL Guide.

Here is an example of an EQL query for generating a list of products, including price and sales numbers, from a data source consisting of individual transactions.

DEFINE Products AS SELECT
ProductName AS ProductName,
ProductSubcategoryName AS ProductSubcategoryName,
ProductCategoryName AS ProductCategoryName,
Description AS Description,
avg("FactSales_SalesAmount") AS AvgSales,
sum("FactSales_SalesAmount") AS SalesSum,
avg(StandardCost) AS AvgStandardCost,
avg(ListPrice) AS AvgListPrice,
(AvgListPrice - AvgStandardCost) AS Profit
GROUP BY ProductName