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

ORA-01752:不能从一个没有键值保存表的视图中删除,不能从一个没有键值保存表的视图中删除

2014-01-28 
delete from (select * from (select rownum nn,t.* from table_1 t) z where z.nn between 1 and 100) 括

delete from
(select * from (select rownum nn,t.* from table_1 t) z
where z.nn between 1 and 100)

括号内的 分页查询 可以查出来数据1-100条,但是删除的时候出现
ORA-01752:不能从一个没有键值保存表的视图中删除

请问这个是什么意思啊?如何解决

这个表没有主键也没有和其它表关联,我也设置过主键,依旧如此

请问怎么解决!

------解决方法--------------------------------------------------------
delete from
(select * from (select rownum nn,t.* from table_1 t) z
where z.nn between 1 and 100) vv where vv.* is not null;


试试


------解决方法--------------------------------------------------------
lz 想删除什么?虚拟表z吗?怎么可能删除呢?
建议改为:
delete from table_1 a
where exists
(
select * from (select rowid rid,rownum nn,t.* from table_1 t) z
where z.nn between 1 and 100 and a.rowid=z.rowid
)
 

        

热点排行