【发布时间】:2022-11-10 18:18:46
【问题描述】:
我在下图中有这张桌子。 我正在尝试选择 DestinationSystemID 为“11”的所有行,其中具有相同 SupplierPartyID 的其他行也没有 DestinationSystemID“16”。
例如,在下表中,应选择以下行,因为它们的行的 DestinationSystem 为 11,但不是 16:
- 7300009017706
- 7300009043088
- 7330509000502
不应选择以下选项,因为它同时具有 DestinationSystemID 11 和 16:
- 7318270000006
我希望你明白我想在这里问什么。
我已尝试搜索解决方案,但无法正确查询问题以找到解决方案。
【问题讨论】:
标签: sql sql-server