我有以下看法包含该数据我可以使用哪种类型的联接重现这些结果
ActivityRecId RegionRecId IsExcluded
1 null 1
2 null 1
3 1 1
3 2 1
4 1 1
5 null 0
我想什么做的是加入了区域表视图上面得到以下记录。
ActivityRecId RegionRecId IsExcluded
1 null 1
2 null 1
3 1 1
3 2 1
3 3 0
3 4 0
4 1 1
4 2 0
4 3 0
4 4 0
5 null 0
区表有以下栏目:
- RegionRecId
- RegionName
任何建议。让我知道你是否需要任何其他信息。
--------------------- CORRECT QUESTION ------------------------
ActivityRecId RegionRecId IsExcluded
1 null 1
2 null 1
3 1 1
3 2 1
3 3 0
3 4 0
4 1 1
4 2 0
4 3 0
4 4 0
5 1 0
5 2 0
5 3 0
5 4 0
如果让活动更容易,活动1和2也可以列出所有的区域。
感谢,
区域表包含什么?你展示的东西看起来更像联合而不是联结。 – Rich 2009-12-21 19:55:24
region表只显示RegionRecId和RegionName – 2009-12-21 19:56:35
没有意义 - 对于提供的内容,表之间没有联接。您需要视图的所有输出,然后列出视图中不存在的区域表中的regionrecid。 – 2009-12-21 20:09:08