Write one update command to update seqno field of a table
on the basis of row number.
Answers were Sorted based on User's Feedback
Answer / rk
update emp_test a set empno=7469 where (select empno from
(select rownum r,empno from emp_test) where r=6 )=a.empno
use seqno in place of empno
Is This Answer Correct ? | 5 Yes | 2 No |
Answer / manoranan sethy
create sequence s1
start with 1
/
create table t1
(
tid number
);
insert into t1 values (s1.nextval);
insert into t1 values (s1.nextval);
insert into t1 values (s1.nextval);
insert into t1 values (s1.nextval);
insert into t1 values (s1.nextval);
select rownum, tid from t1;
update t1 set tid=6 where rownum=1;
select rownum, tid from t1;
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / gourvendra singh
You can update the seqno which is having the rownum=1 only.
for eg:
If you have a table dept in scott user, you can try the
following command:-
update dept
set deptno=90
where rownum=1;
the above will update the record of the table which having
the rownum=1. and if you want to update some other record
then you have to make query to make the required record as
the first record of the table.
Is This Answer Correct ? | 2 Yes | 6 No |
Is nosql relational?
what is cursor. write example of it. What are the attributes of cursor.
Is a view faster than a stored procedure?
What does an inner join do?
Why do we use subquery?
can we delete the trigger in a view? if yes why if not why?
What is scalar data type in pl sql?
Is the primary key an index?
Are sql views compiled?
What is rank dense_rank and partition in sql?
How to retrieve a second highest salary from a table? Note:Suppose salaries are in duplicate values eg: Name Sal Malli 60000 Pandi 60000 Rudra 45000 Ravi 45000
10 Answers Mind Tree, Polaris, Sonata,
What is difference between stored procedures and application procedures?