我想将以下两个查询合并为一个子查询中的一个查询。 首先查询:将两个查询合并到一个子查询中
Select Match_ref, WBE Into Match_ref_Confilct
From RAW_MWBE
where WBE="p" or WBE="n"
group by Match_ref, WBE
第二个查询:
Select Match_ref, count(Match_ref)
from Match_ref_conflict
这样做的目的是与出现不止一次,因此具有的信息冲突match_refs的列表结束。 我想这没有成功:
Select match_Ref, count(match_ref)
From RAW_MWBE
where Exists(Select match_ref, WBE
from RAW_MWBE
where WBE like "P" or WBE like "N")
group by match_ref, WBE
having Count(Match_ref)>1
访问SQL
在哪里可以找到重复;只在p/n记录或所有记录中?你称之为重复的东西;出现多次的match_ref或多次出现的match_ref/wbe对? –