### 案例嵌套案例陈述

``````    CASE
WHEN IND0.M_COM_FUT <>0 AND IND0.M_COM_FUT = IND5.M_COM_IND
THEN
CASE    WHEN IND5.M_COM_IND = CMIND5.M_REFERENCE
THEN
CASE    WHEN CMIND5.M_PHYSICAL = PHYS5.M_REFERENCE
THEN PHYS5.M_LABEL
END
END
ELSE
CASE    WHEN   IND0.M_UNDRL = IND3.M_INDEX AND IND3.M_IND_LAB LIKE '%NBY%' AND IND3.M_COM_NBY_T = 2
THEN
CASE    WHEN  IND3.M_COM_FUT = IND6.M_COM_IND
THEN
CASE    WHEN IND6.M_COM_IND = CMIND6.M_REFERENCE
THEN
CASE    WHEN CMIND6.M_PHYSICAL = PHYS6.M_REFERENCE
THEN PHYS6.M_LABEL
END
END
END
END
ELSE
CASE    WHEN IND0.M_UNDRL = IND3.M_INDEX
THEN
CASE    WHEN IND3.M_COM_IND = CMIND3.M_REFERENCE
THEN
CASE    WHEN CMIND3.M_PHYSICAL = PHYS3.M_REFERENCE
THEN PHYS3.M_LABEL
END
END
END
ELSE
CASE    WHEN   IND0.M_UNDRL = IND3.M_INDEX AND IND3.M_IND_LAB LIKE '%NBY%' AND IND3.M_COM_NBY_T = 0
THEN
CASE    WHEN  IND3.M_COM_FUT = FUT.M_REFERENCE
THEN
CASE    WHEN FUT.M_QUOT_FWD= QUOT.M_REFERENCE
THEN
CASE    WHEN QUOT.M_INDEX = IND0.M_INDEX
THEN PHYS0.M_LABEL
END
END
END
END
ELSE
CASE    WHEN IND0.M_IND_LAB= IND0.M_IND_LAB
THEN PHYS0.M_LABEL
END

END AS PRODUCT,
``````

#### 2 个答案:

``````CASE
WHEN IND0.M_COM_FUT <>0 AND IND0.M_COM_FUT = IND5.M_COM_IND
THEN
CASE    WHEN IND5.M_COM_IND = CMIND5.M_REFERENCE
THEN
CASE    WHEN CMIND5.M_PHYSICAL = PHYS5.M_REFERENCE
THEN PHYS5.M_LABEL
END
END
ELSE
CASE    WHEN   IND0.M_UNDRL = IND3.M_INDEX AND IND3.M_IND_LAB LIKE '%NBY%' AND IND3.M_COM_NBY_T = 2
THEN
CASE    WHEN  IND3.M_COM_FUT = IND6.M_COM_IND
THEN
CASE    WHEN IND6.M_COM_IND = CMIND6.M_REFERENCE
THEN
CASE    WHEN CMIND6.M_PHYSICAL = PHYS6.M_REFERENCE
THEN PHYS6.M_LABEL
END
END
END
ELSE
CASE    WHEN IND0.M_UNDRL = IND3.M_INDEX
THEN
CASE    WHEN IND3.M_COM_IND = CMIND3.M_REFERENCE
THEN
CASE    WHEN CMIND3.M_PHYSICAL = PHYS3.M_REFERENCE
THEN PHYS3.M_LABEL
END
END
ELSE
CASE    WHEN IND0.M_IND_LAB= IND0.M_IND_LAB
THEN PHYS0.M_LABEL
END
END
END
ELSE
CASE    WHEN   IND0.M_UNDRL = IND3.M_INDEX AND IND3.M_IND_LAB LIKE '%NBY%' AND IND3.M_COM_NBY_T = 0
THEN
CASE    WHEN  IND3.M_COM_FUT = FUT.M_REFERENCE
THEN
CASE    WHEN FUT.M_QUOT_FWD= QUOT.M_REFERENCE
THEN
CASE    WHEN QUOT.M_INDEX = IND0.M_INDEX
THEN PHYS0.M_LABEL
END
END
END
END
END AS PRODUCT,
``````

``````CASE
WHEN IND0.M_COM_FUT <> 0
AND IND0.M_COM_FUT = IND5.M_COM_IND
AND IND5.M_COM_IND = CMIND5.M_REFERENCE
AND CMIND5.M_PHYSICAL = PHYS5.M_REFERENCE
THEN PHYS5.M_LABEL
WHEN IND0.M_UNDRL = IND3.M_INDEX
AND IND3.M_IND_LAB LIKE '%NBY%'
AND IND3.M_COM_NBY_T = 2
AND IND3.M_COM_FUT = IND6.M_COM_IND
AND IND6.M_COM_IND = CMIND6.M_REFERENCETHEN
AND CMIND6.M_PHYSICAL = PHYS6.M_REFERENCE
THEN PHYS6.M_LABEL
WHEN IND0.M_UNDRL = IND3.M_INDEX
AND IND3.M_COM_IND = CMIND3.M_REFERENCE
AND CMIND3.M_PHYSICAL = PHYS3.M_REFERENCE
THEN PHYS3.M_LABEL
WHEN IND0.M_UNDRL = IND3.M_INDEX
AND IND3.M_IND_LAB LIKE '%NBY%'
AND IND3.M_COM_NBY_T = 0
AND IND3.M_COM_FUT = FUT.M_REFERENCE
AND FUT.M_QUOT_FWD= QUOT.M_REFERENCE
AND QUOT.M_INDEX = IND0.M_INDEX
THEN PHYS0.M_LABEL
WHEN IND0.M_IND_LAB= IND0.M_IND_LAB
THEN PHYS0.M_LABEL
END
``````