日期:2014-05-17  浏览次数:20838 次

提个oracle数据库删除数据的新手问题
我要删除UserInfo表的第5行到第10行之间的数据

------解决方案--------------------
SQL code

--默认排序的删除
delete UserInfo
    where exists (select 1 from (select rownum rn,UserInfo.主键列 from UserInfo) t
        where t.主键列=UserInfo.主键列 and t.rn between 5 and 10);

------解决方案--------------------
delete UserInfo
where exists (select 1 from (select rownum rn,UserInfo.主键列 from UserInfo) t
where t.主键列=UserInfo.主键列 and t.rn between 5 and 10);




------解决方案--------------------
这个是正解啊
探讨

SQL code

--默认排序的删除
delete UserInfo
where exists (select 1 from (select rownum rn,UserInfo.主键列 from UserInfo) t
where t.主键列=UserInfo.主键列 and t.rn between 5 and 10);



SQL code

--指定排……

------解决方案--------------------
delete from UserInfo where rownum between 5 and 10;
你试一下,看对不?
------解决方案--------------------
探讨
和select * 一样的,没什么用意,就是写起来方便,我的个人习惯,此处用来判断记录存在的