select a.* , b.* from a , b where a.jrnno = b.jrnno

解决方案 »

  1.   

    现欲将A表与B表结合成新表C,并且保证表C记录完整,这个sql语句怎么写啊?
    楼主 是不是想 保证 表A或表B 的记录完整?
    那样还有点意思! 
      

  2.   


    a表对应b的多条的啊?这样操作会出现a中记录出现表c的三条了
      

  3.   

    select a.jrnno ,.. , b.scvxh ...
    from a 
      left join b on b.jrnno = a.jrnno
    where a表的条件jrnno  主键查出一个 就可以了
    我估计你是这个意思 
    你也可以 用 b left join a 
    关键是你想要什么结果
      

  4.   

    select a.jrnno , a.jycode , m.scvbrno , m.scvamt from a , 
    (select t.* from b t where scvamt = (select max(scvamt) from b where jrnno = t.jrnno)) m where a.jrnno = m.jrnno