我们如何得到以下三组的交集?
//A
SELECT
{} ON 0,
EXISTS(
[Customer].[Customer].[Customer].MEMBERS
, {[Product].[Product Categories].[Category].&[1]}
, "Internet Sales")
ON 1
FROM [Adventure Works]
//B
SELECT
{} ON 0,
EXISTS(
[Customer].[Customer].[Customer].MEMBERS
, {[Product].[Product Categories].[Subcategory].&[2]}
, "Internet Sales")
ON 1
FROM [Adventure Works]
//C
SELECT
{} ON 0,
EXISTS(
[Customer].[Customer].[Customer].MEMBERS
, {[Product].[Product Categories].[Product].&[477]}
, "Internet Sales")
ON 1
FROM [Adventure Works]
Product维度中的三个成员是否可以包含一个EXISTS
函数?
我可以在三个EXISTS周围嵌套使用嵌套的INTERSECTION,如下所示,但它看起来非常混乱!...
SELECT
{} ON 0,
INTERSECT(
EXISTS(
[Customer].[Customer].[Customer].MEMBERS
, {[Product].[Product Categories].[Product].&[477]}
, "Internet Sales"),
INTERSECT(
EXISTS(
[Customer].[Customer].[Customer].MEMBERS
, {[Product].[Product Categories].[Category].&[1]}
, "Internet Sales"),
EXISTS(
[Customer].[Customer].[Customer].MEMBERS
, {[Product].[Product Categories].[Subcategory].&[2]}
, "Internet Sales")
)
)
ON 1
FROM [Adventure Works]
答案 0 :(得分:1)
SELECT
{} ON 0
,Exists
(
Exists
(
Exists
(
[Customer].[Customer].[Customer].MEMBERS
,{[Product].[Product Categories].[Subcategory].&[2]}
,"Internet Sales"
)
,{[Product].[Product Categories].[Category].&[1]}
,"Internet Sales"
)
,{[Product].[Product Categories].[Product].&[477]}
,"Internet Sales"
) ON 1
FROM [Adventure Works];
菲利普,