Rediger

Del via


SELECT FROM <model> (DMX)

Applies to: SQL Server Analysis Services

Performs an empty prediction join, returning the most probable value or values for the specified columns. Only the content from the mining model is used to create the prediction.

Syntax

  
SELECT <expression list> [TOP <n>] FROM <model>   
[WHERE <condition list>]   
[ORDER BY <expression> [DESC|ASC]]  

Arguments

expression list
A comma-separated list of expressions, or of predict or predict only columns.

n
Optional. An integer that specifies how many rows to return.

model
A model identifier.

condition list
Optional. Conditions to restrict the values that are returned from the column list.

expression
Optional. An expression that returns a scalar value.

Remarks

The columns in the expression list must be defined as predict or predict only, or related to a predictable column.

Naive Bayes Example

The following example performs an empty prediction join on the Bike Buyer column, returning the most likely state in the TM Naive Bayes mining model.

SELECT ([Bike Buyer]) FROM [TM_Naive_Bayes]  

Time Series Example

The following example performs a prediction on the Amount column in the Forecasting model, returning the next four time steps. The Model Region column combines bike models and regions into a single identifier. The query uses the PredictTimeSeries (DMX) function to perform the prediction.

SELECT [Model Region], PredictTimeSeries(Amount, 4)   
FROM Forecasting  

See Also

SELECT (DMX)
Data Mining Extensions (DMX) Data Definition Statements
Data Mining Extensions (DMX) Data Manipulation Statements
Data Mining Extensions (DMX) Statement Reference