首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

为什么SELECT可以,但换成DELETE 就不可以了呢?解决方法

2012-01-21 
为什么SELECT可以,但换成DELETE 就不可以了呢??select * from table b where (select sum(je) from table

为什么SELECT可以,但换成DELETE 就不可以了呢??
select * from table b where (select sum(je) from table where cid<=b.cid) <= 65

为什么换成:

delete from table b where (select sum(je) from table where cid<=b.cid) <= 65

就不可以了呢,提示有语法错误

请问这句delete 该如何改写才能满足条件,但又不会有语法错误呢,谢谢



[解决办法]

SQL code
delete tfrom t awhere (select   sum(je)   from   t where   cid   <=a.cid)   <=   65
[解决办法]
delete b from table b where (select sum(je) from table where cid <=b.cid) <= 65

热点排行