我有一个查询要停用一些已激活的帐户。基本上,它查看 year_end_close 表,并且那里存在的任何帐户都在主表中更新为非活动状态(A 或 B)。
update master
 set account_type = case account_type
  when 'C' then 'A'
  when 'D' then 'B'
  else account_type
 end
where account_num = 
      (select account_num 
       from year_end_close 
       where account_type in('C', 'D'))`
我从 where 子句中得到“子查询返回超过 1 个值”——我做错了什么?当我注释掉 where 子句时,我不再得到那个错误,所以它在那个子句中。