left join 时涉及两个字段时用 and

select m1.refno as '订单编号',m1.refseq as '订单行号',m1.part,m1.docno as '收料单号',m1.docseq as '收料单行号',m1.txqty as '收料数量',m2.docno as '验收单号',m2.docseq as '验收单行号'
from inv80101 m1 left join inv80101 m2 on m1.docno=m2.refno and m1.docseq=m2.refseq
where m1.refno='PODM91115'

posted @ 2010-04-21 11:54  斑点海豚---寂静的港湾  阅读(438)  评论(0编辑  收藏  举报