--- title: "The Basic MDX Query (MDX) | Microsoft Docs" ms.custom: "" ms.date: "06/13/2017" ms.prod: "sql-server-2014" ms.reviewer: "" ms.technology: "analysis-services" ms.topic: conceptual helpviewer_keywords: - "queries [MDX], SELECT statement" - "queries [MDX], about queries" - "cellsets [MDX]" - "SELECT statement [MDX]" - "cubes [Analysis Services], SELECT statement" ms.assetid: 4fa5a95a-fec9-4584-875c-dbf030c53e82 author: minewiskan ms.author: owend manager: craigg --- # The Basic MDX Query (MDX) The basic Multidimensional Expressions (MDX) query is the SELECT statement-the most frequently used query in MDX. By understanding how an MDX SELECT statement must specify a result set, what the syntax of the SELECT statement is, and how to create a simple query using the SELECT statement, you will have a solid understanding of how to use MDX to query multidimensional data. ## Specifying a Result Set In MDX, the SELECT statement specifies a result set that contains a subset of multidimensional data that has been returned from a cube. To specify a result set, an MDX query must contain the following information: - The number of axes that you want the result set to contain. You can specify up to 128 axes in an MDX query. - The set of members or tuples to include on each axis of the MDX query. - The name of the cube that sets the context of the MDX query. - The set of members or tuples to include on the slicer axis. For more information about slicer and query axes, see[Restricting the Query with Query and Slicer Axes (MDX)](mdx-query-and-slicer-axes-restricting-the-query.md). To identify the query axes, the cube that will be queried, and the slicer axis, the MDX SELECT statement uses the following clauses: - A SELECT clause that determines the query axes of an MDX SELECT statement. For more information about the construction of query axes in a SELECT clause, see [Specifying the Contents of a Query Axis (MDX)](mdx-query-and-slicer-axes-specify-the-contents-of-a-query-axis.md). - A FROM clause that determines which cube will be queried. For more information about the FROM clause, see [SELECT Statement (MDX)](/sql/mdx/mdx-data-manipulation-select). - An optional WHERE clause that determines which members or tuples to use on the slicer axis to restrict the data returned. For more information about the construction of a slicer axis in a WHERE clause, see [Specifying the Contents of a Slicer Axis (MDX)](mdx-query-and-slicer-axes-specify-the-contents-of-a-slicer-axis.md). > [!NOTE] > For more detailed information about the various clauses of the SELECT statement, see [SELECT Statement (MDX)](/sql/mdx/mdx-data-manipulation-select). ## SELECT Statement Syntax The following syntax shows a basic SELECT statement that includes the use of the SELECT, FROM, and WHERE clauses: ``` [ WITH ... ] ] SELECT [ * | ( ... ] ) ] FROM ] [