GENERATE CUBES

Generates cubes from a query.

Syntax

GENERATE CUBE {cubes-tag} 
[WITH WHERE where-expression] FROM select-statement

Description

Cube tag and query (select statement) must be provided.

Cubes with a Filter
To create a cube with a filter (a cube with where statement), use the WITH WHERE clause. Cubes with WHERE are generated using filtered data, based on the given where expression, and can be applied only to queries that include identical where expression in their where clause.

Example

GENERATE CUBES mycube 
FROM 
SELECT PRODUCT, SUM(PRICE)
FROM T_PRODUCT
WHERE COUNTRY='US'
GROUP BY PRODUCT;


cube tag | status                | rows | candidate query
---------------------------------------------------------------------
cube1    | finished successfully |   13 | SELECT sales_demo.store_country,
                                        | sales_demo.store_name,
                                        | sum(sales_demo.net_profit)  
                                        | FROM 
                                        | sales_demo
                                        | GROUP BY 
                                        | sales_demo.store_country,
                                        | sales_demo.store_name
---------------------------------------------------------------------

See Also

DROP CUBES