在冒险作品中,这两种情况有什么区别:
1)From子句中的过滤器成员:
with
member [existing_categries_Member_Count]as
count(existing[Product].[Category].[Category].members)
member [existing_subcategries_Member_Count]as
count(existing[Product].[subCategory].[subCategory].members)
select
{
[existing_subcategries_Member_Count],
[existing_categries_Member_Count]
} on 0
FROM (
SELECT [Product].[Subcategory].&[31] ON 0
FROM [Adventure Works])
结果:
existing_subcategries_Member_Count existing_categries_Member_Count
37 4
和 2) 在 WHERE 子句中过滤成员:
with
member [existing_categries_Member_Count]as
count(existing[Product].[Category].[Category].members)
member [existing_subcategries_Member_Count]as
count(existing[Product].[subCategory].[subCategory].members)
select
{
[existing_subcategries_Member_Count],
[existing_categries_Member_Count]
} on 0
FROM [Adventure Works]
WHERE [Product].[Subcategory].&[31]
结果 :
existing_subcategries_Member_Count existing_categries_Member_Count
1 1
我希望这两个查询的结果相同,但我看到不同的结果。请告诉我 WHERE 和 SUBcube 之间的区别谢谢