尝试更新bigquery中的表,但收到一条错误消息,指出
“ UPDATE / MERGE必须与每个目标行最多匹配一个源行”
update Data_Layer.ClassCategories cc
set cc.MovmentTypeId = t.MovementTypeId,
cc.IntensityId = t.IntensityId
FROM
AloomaTest.testfile t
where cc.CategoryId = t.CategoryId
然后我尝试了该查询
update Data_Layer.ClassCategories cc
set cc.MovmentTypeId = (select MovementTypeId from AloomaTest.testfile t
where cc.CategoryId = t.CategoryId ),
cc.IntensityId = (select IntensityId from AloomaTest.testfile t where
cc.CategoryId = t.CategoryId )
where cc.CategoryId IN ( select CategoryId from AloomaTest.testfile)
得到此错误错误:标量子查询产生了多个元素
试图更新类别字段ovementtype和intenstitype