Every query using the SELECT statement has the following basic format. Items in [brackets] are optional.
[<with_section>] SELECT [<axis_specification> [, <axis_specification>...]] [FROM [<cube_specification>]] [WHERE [<slicer_specification>]]
Item | Description |
---|---|
<with_section> | An optional section, beginning with the keyword WITH, in which you can define referenceable sets or members. |
SELECT | A literal keyword that must precede axis specifications. |
[<axis_specification> [,<axis_specification>...]] | Any number of comma-separated axis specifications. Axes represent an n dimensional cube schema. Each axis is conceptually a framework for retrieving a data set; for example, one axis could be thought of as a column, and the next could be considered a row. See MDX Axis Specifications for more information. |
FROM | A literal keyword that must precede the cube specification. |
<cube_specification> | The name of the database from which to select. If left blank, the current database context is assumed. |
WHERE | A literal keyword that must precede the slicer specification, if one is used. |
<slicer_specification> | A tuple, member, or set representing any further level of filtering you want done on the results. For example, you may want the entire query to apply only to Actual Sales in the Sample Basic database, excluding budgeted sales. The WHERE clause might look like the following:WHERE ([Scenario].[Actual], [Measures].[Sales]) |