并且在fnproduct()中还有variantSKU所以我想加入这两个 这是我的代码
select * from dbo.fnproduct() join ##dq_IsUnique on
dbo.fnproduct().VariantSKU= ##dq_IsUnique.VariantSKU
但我收到错误
Cannot find either column "dbo" or the user-defined function or aggregate
"dbo.fnproduct", or the name is ambiguous.
帮助我解决它
答案 0 :(得分:2)
无需在加入逻辑
时再次指定或调用该函数select *
from dbo.fnproduct() t
join ##dq_IsUnique on t.VariantSKU = ##dq_IsUnique.VariantSKU
答案 1 :(得分:1)
未经测试但请尝试这样做。使用交叉申请。
SELECT * FROM ##dq_IsUnique U
CROSS APPLY
(
select * from dbo.fnproduct()
WHERE VariantSKU = U.VariantSKU
)p