返回匹配两个键的行,删除那些只匹配一个键的行。 [英] Returning rows that match two keys, exculding those that match only one.

查看:70
本文介绍了返回匹配两个键的行,删除那些只匹配一个键的行。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在一个带有两个外键列的表上运行查询 - wID和dID定义了多对多的关系。我知道两个不同的wID的值(wID = 1,wID = 2),我只需要找到与两个匹配的dID',但不包括只匹配一个的那个。


我已经做到了这一点:

展开 | 选择 | Wrap | 行号

解决方案

嗨。


更改此部分:

展开 | 选择 | 换行 | 行号


嗯,我没有得到任何结果..我认为这是因为两个wID都来自同一列而不是同一行..

展开 | 选择 | Wrap | 行号



嗯我没有得到任何结果..我认为这是因为两个wID都来自同一列而不是同一行..

展开 | 选择 | Wrap | 行号

I''m running a query on a table with two foreign key columns- wID and dID which define a many to many relationship. I know the value of two different wID''s ( wID=1, wID=2) and I need to find only the dID''s that match BOTH wID''s excluding those that match only one.

I have made it this far:

Expand|Select|Wrap|Line Numbers

解决方案

Hi.

Change this part:

Expand|Select|Wrap|Line Numbers


Hmmm i didn''t get any results back.. i think it''s because both wID''s are from the same column but not the same row..

Expand|Select|Wrap|Line Numbers


Hmmm i didn''t get any results back.. i think it''s because both wID''s are from the same column but not the same row..

Expand|Select|Wrap|Line Numbers


这篇关于返回匹配两个键的行,删除那些只匹配一个键的行。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆