--- title: "SELECT (DMX) | Microsoft Docs" ms.date: 06/07/2018 ms.prod: sql ms.technology: analysis-services ms.custom: dmx ms.topic: conceptual ms.author: owend ms.reviewer: owend author: minewiskan --- # SELECT (DMX) [!INCLUDE[ssas-appliesto-sqlas](../includes/ssas-appliesto-sqlas.md)] The **SELECT** statement in Data Mining Extensions (DMX) is used for the following tasks in data mining: - Browsing the content of an existing mining model - Creating predictions from an existing mining model - Creating a copy of an existing mining model - Browsing the mining structure Although the full syntax of this statement is complex, the primary clauses used for browsing a model and its underlying structure can be summarized as follows: ``` SELECT [FLATTENED] [TOP ] FROM ... ``` ## TOP \ and ORDER BY You can order the results of a query by using an expression, and can then return a subset of the results by using a combination of the **ORDER BY** and **TOP** clauses. This is useful in a scenario such as targeted mailing where you only want to send results to the most likely respondents. You could order the results of a target mailing prediction query by the prediction probability, and then only return the top \ results. ## Select List The *\* of the **SELECT** statement, and can only return a Boolean expression. The syntax for the **WHERE** clause is as follows ``` WHERE < condition expression > ``` The select list and **WHERE** clause of a **SELECT** statement must follow the following rules: - The select list must contain an expression that does not return a Boolean result. You can modify the expression, but the expression must return non-Boolean results. - The **WHERE** clause must contain an expression that returns a Boolean result. You can modify the clause, but it must return a Boolean result. ## Predictions There are two types of syntax that you can use for creating predictions: - [SELECT FROM <model> PREDICTION JOIN (DMX)](../dmx/select-from-model-prediction-join-dmx.md) - [SELECT FROM <model> (DMX)](../dmx/select-from-model-dmx.md) The first type of prediction enables you create complex predictions either in real time or as a batch. The second prediction type creates an empty prediction join on a predictable column in a mining model, and returns the most likely state of the column. The results of this query are completely based on the content of the mining model. You can insert a select statement into the source query of a SELECT FROM PREDICTION JOIN statement by using the following syntax. ``` SELECT FROM PREDICTION JOIN ( ``` For more information about creating prediction queries, see [Structure and Usage of DMX Prediction Queries](../dmx/structure-and-usage-of-dmx-prediction-queries.md). ## Clause Syntax Because of the complexity of browsing with the **SELECT** statement, detailed syntax elements and arguments are described by clause. For more information about each clause, click a topic in the following list: [SELECT DISTINCT FROM <model > (DMX)](../dmx/select-distinct-from-model-dmx.md) [SELECT FROM <model>.CONTENT (DMX)](../dmx/select-from-model-content-dmx.md) [SELECT FROM <model>.CASES (DMX)](../dmx/select-from-model-cases-dmx.md) [SELECT FROM <model>.SAMPLE_CASES (DMX)](../dmx/select-from-model-sample-cases-dmx.md) [SELECT FROM <model>.DIMENSION_CONTENT (DMX)](../dmx/select-from-model-dimension-content-dmx.md) [SELECT FROM <model> PREDICTION JOIN (DMX)](../dmx/select-from-model-prediction-join-dmx.md) [SELECT FROM <model> (DMX)](../dmx/select-from-model-dmx.md) [SELECT FROM <structure>.CASES](../dmx/select-from-structure-cases.md) ## See Also [Data Mining Extensions (DMX) Data Definition Statements](../dmx/dmx-statements-data-definition.md) [Data Mining Extensions (DMX) Data Manipulation Statements](../dmx/dmx-statements-data-manipulation.md) [Data Mining Extensions (DMX) Statement Reference](../dmx/data-mining-extensions-dmx-statements.md) [Data Mining Extensions (DMX) Data Manipulation Statements](../dmx/dmx-statements-data-manipulation.md)