目的:比对两个表之间的差异(1、是否一样的料号,是否一样的数量)
原始表1资料
select tc_sgyud02,tc_sgyud10,tc_sgy03,tc_sgy04,tc_sgy07
from tc_sgy_file
where tc_sgyud02 is not null
and substrb(tc_sgy01,1,8) in (‘G19-0038’,‘B36-0015’)
原始表2资料
select tc_sgn11 ,tc_sgn12 , tc_sgn03,tc_sgn04,tc_sgn06
from tc_sgn_file
where tc_sgn11 is not null
处理步骤:
1、先用union将两句sql合并
select tc_sgyud02,tc_sgyud10,tc_sgy03,tc_sgy04,tc_sgy07,’’ tc_sgn03,’’ tc_sgn04,0 tc_sgn06
fr