计算两个集合,并移除第一个集合中也存在于第二个集合中的元组,并可选择保留重复的元组。
Syntax
Except(Set_Expression1, Set_Expression2 [, ALL ] )
Arguments
Set_Expression1
一个有效的多维表达式(MDX)表达式,返回集合。
Set_Expression2
一个有效的多维表达式(MDX)表达式,返回集合。
Remarks
如果指定为 ALL 函数,函数保留第一个集合中的重复;第二套中发现的重复物品仍会被移除。 成员按第一套出现的顺序返回。
示例
以下示例展示了该函数的使用方法。
//This query shows the quantity of orders for all products,
//with the exception of Components, which are not
//sold.
SELECT
[Date].[Month of Year].Children ON COLUMNS,
Except
([Product].[Product Categories].[All].Children ,
{[Product].[Product Categories].[Components]}
) ON ROWS
FROM
[Adventure Works]
WHERE
([Measures].[Order Quantity])