select sell_id as bill_id , client_id , job_date , account , sell_type as bill_type , memo from 表A union select fare_id as bill_id , client_id , job_date , account , fare_type as bill_type , memo from 表B
select * from a union all select * from (select fare_id as sell_id,client_id, job_date , account bill_type as sell_type ,memo from b)c
是这个?select sell_id as bill_id ,client_id ,job_date ,account ,sell_type as bill_type ,memo from A union select ,fare_id ,client_id ,job_date ,account ,fare_type ,memo from B
, memo from 表A
union
select fare_id as bill_id , client_id , job_date , account , fare_type as bill_type
, memo from 表B
union all select * from (select fare_id as sell_id,client_id, job_date , account bill_type as sell_type ,memo from b)c
,client_id
,job_date
,account
,sell_type as bill_type
,memo
from A
union
select ,fare_id
,client_id
,job_date
,account
,fare_type
,memo
from B
表A sell_id client_id job_date account sell_type memo
s0001 00001 05-9-1 100 销售
s0002 00001 05-9-1 200 销售
s0003 00002 05-9-1 100 销退表B fare_id client_id job_date account fare_type memo
f0001 00001 05-9-2 -50 付 退差价汇总合并后
bill_id client_id job_date account bill_type memo
s0001 00001 05-9-1 100 销售
s0002 00001 05-9-1 200 销售
s0003 00002 05-9-1 100 销退
f0001 00001 05-9-2 -50 付 退差价