我正在尝试创建一个自定义列,该列是2个现有列的乘积。
(
select
omdDeliveryQty * omlUnitPriceBase AS 'Value'
) *
from
SalesOrderDeliveries
Left Outer Join SALESORDERLINES On OMDSALESORDERID = OMLSALESORDERID
And OMDSALESORDERLINEID = OMLSALESORDERLINEID
答案 0 :(得分:0)
您可能想要:
select
*,
d.omdDeliveryQty * l.omlUnitPriceBase AS 'Value'
from SalesOrderDeliveries d
left outer join SALESORDERLINES l
on d.OMDSALESORDERID = l.OMLSALESORDERID
and d.OMDSALESORDERLINEID = l.OMLSALESORDERLINEID
别忘了为每个表添加别名(我添加了d
和l
),以使查询更易于阅读和调试。