我有两个查询,我需要找出它们的结果集之间的差异。我的查询如下。
select star_ident,transition_ident,fix_ident,min(sequence_num)
from corept.std_star_leg c
where airport_ident='KLAS' and data_supplier='J'
group by star_ident,transition_ident;
select name,trans
from skyplan_deploy.deploy_stars
where apt='KLAS';
这是我的两个查询。我最初使用左连接但未能得到结果。
select star_ident,transition_ident,fix_ident,min(sequence_num)
from corept.std_star_leg c
left join
(
select name,trans
from skyplan_deploy.deploy_stars
where apt='KLAS' and name != trans
) a
on star_ident=a.name and fix_ident=a.trans
where airport_ident='KLAS' and data_supplier='J' and a.name is null
group by star_ident,transition_ident;
我尝试了上面的查询,但它完全给出了错误的结果集。谁能帮我做这个?
谢谢你。