日期:2014-05-17 浏览次数:20788 次
SELECT OrderNum=(case when item.docnum is not null then item.DocNum else ORDR.DocNum end).....
FROM TB
INNER JOIN...
ON ...
WHERE
( case when item.docnum is not null then item.DocNum=1 else ORDR.DocNum=1 end)
( case when item.docnum is not null then item.DocNum else ORDR.DocNum end)=1