0
我需要通过在Country
和Itemcode
接合表T1和T2以填充柱ISkeyProduct
(参见表附件)。列iskeyproduct
中的最终值应该为True或False,但不为NULL。
我的代码是:
Update T1
Set IsKeyProduct = Case
When t2.ItemCode is not Null Then 1 Else 0
End
From T1
Left join T2 on t1.ShopCountry = t2.Country
and t1.ItemCode = case when t2.ItemCode
Where
(t1.ItemCode is not Null and t2.ItemCode is not null)
但与此代码我得到一系列的“1”和NULL。 – Ramaq
您的样本中哪一个是T1,哪一个是T2? \t请阅读[**如何提问**](http://stackoverflow.com/help/how-to-ask) \t \t这里是[** START **]( http://spaghettidba.com/2015/04/24/how-to-post-at-sql-question-on-a-public-forum/)了解如何提高您的问题质量并获得更好的答案。 –
那么问题是什么?你有错误?意外的结果? –