Siebel Analytics Server Administration Guide > SQL Reference > SQL Syntax and Semantics >

SELECT List Syntax


The SELECT list syntax lists the columns in the query.

Syntax:

SELECT [DISTINCT] select_list

where:

select_list
The list of columns specified in the query. All columns need to be from a single business model.
Table names can be included (as Table.Column), but are optional unless column names are not unique within a business model.
If column names contain spaces, enclose column names in double quotes. The DISTINCT keyword does not need to be included as the Siebel Analytics Server will always do a distinct query.
Columns that are being aggregated do not need to include the aggregation function (such as SUM), as aggregation rules are known to the server and aggregation will be performed automatically.

FROM Clause Syntax

The Siebel Analytics Server accepts any valid SQL FROM clause syntax. You can specify the name of a catalog folder instead of a list of tables to simplify FROM clause creation. The Siebel Analytics Server determines the proper tables and the proper join specifications based on the columns the query asks for and the configuration of the Siebel Analytics Server repository.

WHERE Clause Syntax

The Siebel Analytics Server accepts any valid SQL WHERE clause syntax. There is no need to specify any join conditions in the WHERE clause because the joins are all configured within the Siebel Analytics Server repository. Any join conditions specified in the WHERE clause are ignored.

The Siebel Analytics Server also supports the following subquery predicates in any conditional expression (WHERE, HAVING or CASE statements):

GROUP BY Clause Syntax

With the Siebel Analytics Server's auto aggregation feature, there is no need to submit a GROUP BY clause. When no GROUP BY clause is specified, the GROUP BY specification defaults to all of the nonaggregation columns in the SELECT list. If you explicitly use aggregation functions in the select list, you can specify a GROUP BY clause with different columns and the Siebel Analytics Server will compute the results based on the level specified in the GROUP BY clause. For additional details, and some examples of using the GROUP BY clause in queries against the Siebel Analytics Server, see Rules for Queries with Aggregate Functions.

ORDER BY Clause Syntax

The Siebel Analytics Server accepts any valid SQL ORDER BY clause syntax, including referencing columns by their order in the select list (such as ORDER BY 3, 1, 5).


 Siebel Analytics Server Administration Guide 
 Published: 23 June 2003