Data deleted with IN clause even if the column doesn't exist
问题 So, here is the test query you could play with: select top 10 * into #tmp FROM A delete from #tmp WHERE xxx_id in (select xxx_id FROM B) Actually, all these 10 records are deleted. The question is why are these 10 records deleted? Note: xxx_id is one column in table A only, it doesn't exist in table B . But the delete statement "works" anyway. Here's a demonstration of this behaviour: http://sqlfiddle.com/#!6/963f9/1/1 Update I found the answer in MSDN: http://social.msdn.microsoft.com/Forums