0

尝试在 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)

收到此错误错误:标量子查询产生了多个元素

测试文件的样本数据 在此处输入图像描述

Classcategories 的样本数据 在此处输入图像描述

尝试更新类类别字段 ovementtype 和 intenstitype

4

0 回答 0