问题描述:

how/why would the result set of this: (returns 1215 records)

SELECT UM2.UCN_Group, UM2.UCN, UM2.Cust_EDP

FROM CleanRoom.dbo.UCN_Master AS UM

JOIN CleanRoom.dbo.UCN_Master AS UM2

ON UM.UCN_Group = UM2.UCN_Group

WHERE UM.UCN_Group NOT LIKE 'EXPN%'

be different from this: (returns 1203 records)

SELECT UM2.UCN_Group, UM2.UCN, UM2.Cust_EDP

FROM CleanRoom.dbo.UCN_Master AS UM2

WHERE UM2.UCN_Group NOT LIKE 'EXPN%'

shouldn't the JOIN condition on the first query ensure same result set from both queries? TIA

网友答案:

I can see the only reason for this: you've got rows with identical UCN_Group values.

相关阅读:
Top