我有两个查询导致两个结果集需要比较两个结果集并需要显示它们之间的差异。希望我会得到很好的支持。谢谢。这些是我的查询获取两个查询之间的数据差异
查询:1个
SELECT distinct c.sid_ident,c.fix_ident from corept.std_sid_leg as c INNER JOIN (SELECT sid_ident, transition_ident, max(sequence_num) seq, route_type FROM corept.std_sid_leg WHERE data_supplier='J' AND airport_ident='KBOS' GROUP BY sid_ident,transition_ident) b ON c.sequence_num=b.seq and c.sid_ident = b.sid_ident and c.transition_ident =b.transition_ident WHERE c.data_supplier='J' and c.airport_ident='KBOS';
查询:2
SELECT name,trans FROM skyplan_deploy.deploy_sids ON d.name=c.sid_ident WHERE apt = 'KBOS' AND name != trans;
比较是必须要做的上字段在skplan_deplay.deploy_sids corept.std_sid_leg和名称sid_ident。由于Mysql不支持完整的外连接,所以我想使用左连接和右连接并结合两个结果。但是我坚持这样做。请帮助。我在使用左右连接时出现语法错误。谢谢。
我提供的语法使用LEFT JOIN以及右join..so,我可以既工会结果 – user2037445 2013-03-21 09:05:02
使用搜索功能始终是一个良好的开端,以上述两种查询组合。把你的查询放入子查询并阅读:http://stackoverflow.com/questions/4796872/full-outer-join-in-mysql – fancyPants 2013-03-21 09:45:38