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 |
what are the different types of joins?
What is materialised View?
What is case function?
Who developed sql?
What is sql*loader and what is it used for? : aql loader
Is sql pronounced sequel or sql?
what is data integrity
function can return value ,procedure also return value through out parameter then what is the difference?
differentiate between float and double. : Sql dba
How do I tune a sql query?
How is a PL/SQL code compiled?
What is graph sql?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)