这条SQL如何改?
select OPOR.DocEntry, DocDueDate, ItemCode, Dscription, Quantity,
(POR1.Quantity - ISNULL((select SUM(U_Cnt) from [@ENT_QMMR] where U_CsCode = OPOR.CardCode and U_RecDt = OPOR.DocDueDate and U_ItemCode = POR1.ItemCode) , 0))
as Cnt1 from OPOR
join POR1 on OPOR.DocEntry = POR1.DocEntry
where OPOR.DocEntry = 1
order by LineNum
运行的时候报错:
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS