日期:2014-05-18 浏览次数:20707 次
delete a from #ta a where exists (select 1 from #tb b where a.id=b.id)
------解决方案--------------------
delete #ta from #ta a where exists (select 1 from #tb where id=a.id)
------解决方案--------------------
学习一下
------解决方案--------------------
终于明白为什么了,原来DEL语句真正删除的是delete语句后的那张表不信建张#tc表打上
delete #tc from 后的语句随便打只要符合语法规则出不出现#tc无所谓看看究竟被删除的是那张表
------解决方案--------------------
delete a--用别名 from #ta a where exists (select 1 from #tb b where a.id=b.id) delete #ta --用别名 from #ta a where exists (select 1 from #tb b where a.id=b.id) -------以上两种都可以
------解决方案--------------------
学习