SELECT Statement (MDX)
Retrieves data from a specified cube.
Syntax
[ WITH <SELECT WITH clause>
[ , <SELECT WITH clause>...n ]
]
SELECT
[ *
| ( <SELECT query axis clause>
[ , <SELECT query axis clause>,...n ]
)
]
FROM
<SELECT subcube clause>
[ <SELECT slicer axis clause> ]
[ <SELECT cell property list clause> ]
<SELECT WITH clause> ::=
( CELL CALCULATION <CREATE CELL CALCULATION body clause> )
| ( [ CALCULATED ] MEMBER <CREATE MEMBER body clause>)
| ( SET <CREATE SET body clause>)
<SELECT query axis clause> ::=
[ NON EMPTY ] Set_Expression
[ <SELECT dimension property list clause> ]
ON
Integer_Expression
| AXIS(Integer)
| COLUMNS
| ROWS
| PAGES
| SECTIONS
| CHAPTERS
<SELECT subcube clause> ::=
Cube_Name
| (SELECT
[ *
| ( <SELECT query axis clause> [ ,
<SELECT query axis clause>,...n ] )
]
FROM
<SELECT subcube clause>
<SELECT slicer axis clause> )
<SELECT slicer axis clause> ::=
WHERE Tuple_Expression
<SELECT cell property list clause> ::=
[ CELL ] PROPERTIES CellProperty_Name
[ , CellProperty_Name,...n ]
<SELECT dimension property list clause> ::=
[DIMENSION] PROPERTIES
(DimensionProperty_Name
[,DimensionProperty_Name,...n ] )
| (LevelProperty_Name
[, LevelProperty_Name,...n ] )
| (MemberProperty_Name
[, MemberProperty_Name,...n ] )
Arguments
- Set_Expression
A valid Multidimensional Expressions (MDX) expression that returns a set.
- Integer
An integer between 0 and 127.
- Cube_Name
A valid string that provides a cube name.
- Tuple_Expression
A valid Multidimensional Expressions (MDX) expression that returns a tuple.
- CellProperty_Name
A valid string that represents a cell property.
- DimensionProperty_Name
A valid string that represents a dimension property.
- LevelProperty_Name
A valid string that represents a level property.
- MemberProperty_Name
A valid string that represents a member property.
Remarks
The <SELECT slicer axis clause>
expression must contain members in dimensions and hierarchies other than those referenced in the specified <SELECT query axis clause>
expressions.
If an attribute in the cube is omitted from the specified <SELECT query axis clause>
expressions and the <SELECT slicer axis clause>
value, the attribute's default member is implicitly added to the slicer axis.
Example
The following example returns the sum of the Measures.[Order Quantity]
member, aggregated over the first eight months of calendar year 2003 that are contained in the Date
dimension, from the Adventure Works cube.
WITH MEMBER [Date].[Calendar].[First8Months2003] AS
Aggregate(
PeriodsToDate(
[Date].[Calendar].[Calendar Year],
[Date].[Calendar].[Month].[August 2003]
)
)
SELECT
[Date].[Calendar].[First8Months2003] ON COLUMNS,
[Product].[Category].Children ON ROWS
FROM
[Adventure Works]
WHERE
[Measures].[Order Quantity]
See Also
Concepts
Key Concepts in MDX (MDX)
Restricting the Query with Query and Slicer Axes (MDX)
Other Resources
MDX Data Manipulation Statements (MDX)
Help and Information
Getting SQL Server 2005 Assistance
Change History
Release | History |
---|---|
17 July 2006 |
|