select
*
from(
select
order_code
,external_order_code
,total_order_code
,order_type
,business_type
,order_tag
,channel_code
,terminal
,shop_code
,shop_name
,customer_id
from b_order -- 原订单表
where ds = ${bizdate}
)t1
full join(
select
order_code
,external_order_code
,total_order_code
,order_type
,business_type
,order_tag
,channel_code
,terminal
,shop_code
,shop_name
,customer_id
from b_order_process -- 新加工的表
)t2
on t1.order_code = t2.order_code
where nvl(t1.order_code,'') <> nvl(t2.order_code,'')
以上sql会查询出左表和右表中未关联上的数据。当两张表进行数据对比时可以使用该sql。