(SQL-T-SQL) 选择命令仅具有某些值?
这是我的表app_extra:
AppID;AppExtraID
100;0
100;1
100;3
100;7
100;8
100;9
110;0
110;2
110;4
110;7
110;9
115;0
115;2
115;6
115;8
120;0
120;1
120;10
130;0
130;7
130;8
130;10
140;0
140;1
140;3
150;0
150;2
150;6
150;7
150;8
150;10
160;0
160;8
160;10
165;0
165;8
165;10
170;0
170;2
170;8
170;10
180;0
180;1
180;5
180;7
180;10
185;0
185;1
185;7
185;10
190;0
190;2
我想知道如何只拥有 AppID 而没有 9 和 10 AppExtraID
谢谢!
Here is my table app_extra:
AppID;AppExtraID
100;0
100;1
100;3
100;7
100;8
100;9
110;0
110;2
110;4
110;7
110;9
115;0
115;2
115;6
115;8
120;0
120;1
120;10
130;0
130;7
130;8
130;10
140;0
140;1
140;3
150;0
150;2
150;6
150;7
150;8
150;10
160;0
160;8
160;10
165;0
165;8
165;10
170;0
170;2
170;8
170;10
180;0
180;1
180;5
180;7
180;10
185;0
185;1
185;7
185;10
190;0
190;2
I would like to know how to have only the AppID that doesn't have 9 and 10 AppExtraID
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我明白你的意思了...
内部选择将识别所有具有 9 或 10 额外值的应用程序 ID。这些行将被排除在主选择中。任何与 9 或 10 相关的 AppID 都将被消除,即使它们还有另一个额外的 ID。
I see what you are getting at...
The inner select will identify all App ID's which have a 9 or a 10 extra. These rows will then be excluded in the main select. Any AppID which is related to 9 or 10 will be eliminated, even if they also have another extra ID.
修改以满足您的评论的愿望。
Modified to suit your comment's desire.
要获取满足要求的
AppID
的唯一列表:To get a unique list of
AppID
that fulfill the reqirement: