我在图像中得到的数据是正确的(链接在下面).Please看看下面的查询。
SELECT * FROM dbo.DrugInteraction WHERE Drug='clarithromycin' AND DrugInteraction='afatinib'
SELECT * FROM dbo.DrugInteraction WHERE Drug='afatinib' AND DrugInteraction='clarithromycin'如果仔细观察,你会发现,药物和药物相互作用的列值是互换使用的,我有数千条这样的记录,但描述保持不变。
所以,我想要的最后一个输入是,description字段only.Can任何人都能在这方面帮助我。

发布于 2017-01-07 22:29:51
您可以使用以下命令获取每对的"first“值:
select di.*
from dbo.DrugInteraction di
where drug < druginteraction
union all
select di.*
from dbo.DrugInteraction di
where drug > druginteraction and
not exists (select 1
from dbo.DrugInteraction di2
where di2.drug = di.druginteraction and di2.druginteraction = di.drug
);https://stackoverflow.com/questions/41522431
复制相似问题