I'm getting this error while I'm trying to use IN clause with UPDATE:Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.This works:declare @idList table( id int);insert into @idListselect id1 from MyTable1select * from MyTable2where id2 in( select id from @idList)
This doesn't:declare @idList table( id int);insert into @idListselect id1 from MyTable1update MyTable2set column = 1where id2 in( select id from @idList)
Neither does this:declare @idList table( id int);insert into @idListselect id1 from MyTable1update MyTable2set MyTable2.column = 1from MyTable2inner join @idList ion MyTable2.id2 = i.id
Any idea what I am doing wrong?