想更新status =60 的前5条记录:
update (select num2 ,status,rownum rn from xgs_register where status = 60 and rownum<5)
set num2 = trunc(dbms_random.value(0, 299))
update (select num2 ,status,rownum rn from xgs_register )
set num2 = trunc(dbms_random.value(0, 299))
where status = 60 and rn<5 上面二种方法,都报 此视图的数据操作非法的错误哪道是因为没有主键原因的吗
该怎么改
update (select num2 ,status,rownum rn from xgs_register where status = 60 and rownum<5)
set num2 = trunc(dbms_random.value(0, 299))
update (select num2 ,status,rownum rn from xgs_register )
set num2 = trunc(dbms_random.value(0, 299))
where status = 60 and rn<5 上面二种方法,都报 此视图的数据操作非法的错误哪道是因为没有主键原因的吗
该怎么改
set x=xxx
where status = 60 and rownum<5
行不行
update xgs_register
set num2= trunc(dbms_random.value(0, 299))
where status=60 and rownum<5;
update xgs_register
set num2= trunc(dbms_random.value(0, 299))
where status=60 and rownum<=5;
update student
set sdept='MA'
where rowid in
(select rd from
(select rowid rd,rownum rn from student)
where rn>=1 and rn<=5);
这句不对,它是返回前5条记录中的status = 60 的记录,不是返回所有status=60记录中的前5条
顶8楼!