如果按你说的表三来显示,估计一句SQL是不行
select table1.*,isnull(table2.fkje,0) from table1 left join table2 on table1.cdmc=table2.cdmc

解决方案 »

  1.   

    Update tbl3 (车队名称, 时间, 应付金额, 付款金额) from
    (select tbl1.车队名称, tbl1.时间,  tbl1.应付金额, tbl2.付款金额, from tbl1,tbl2 where tbl1.车队名称=tbl2.车队名称 )
      

  2.   

    Insert INTO tbl3 (车队名称, 时间, 应付金额, 付款金额) from
    (select tbl1.车队名称, tbl1.时间,  tbl1.应付金额, tbl2.付款金额, from tbl1,tbl2 where tbl1.车队名称=tbl2.车队名称 )
      

  3.   

    Insert INTO tbl3 (车队名称, 时间, 应付金额, 付款金额) select tbl1.车队名称, tbl1.时间,  tbl1.应付金额, tbl2.付款金额 from tbl1 left join tbl2 on tbl1.车队名称=tbl2.车队名称