How can we manage the gap in a primary key column created
by a sequence?
Ex:a company has empno as primary key generated by a
sequence and some employees leaves in between.What is the
best way to manage this gap?
Answer Posted / poornima
using cursor we find the gap in sequence, but this method
is quite complicated and slow process...
so we use some analyical fuctions such as lead and lag as
{LEAD | LAG} (value_expression, offset, default)
OVER ([PARTITION BY expr] ORDER BY expr)
Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
Is oracle the best database?
How to define a data source name (dsn) in odbc manager?
What is primefaces used for?
How can I introduce multiple conditions in like operator?
Can we store pictures in the database and if so, how it can be done?
What is recovery manager in Oracle?
What is transaction control statement and how many types of transaction control statement in Oracle?
What is sharded cluster?
How to unlock the sample user account in oracle?
What is background process in Oracle?
What is the difference between formal parameters and actual parameters?
Database is hung. Old and new user connections alike hang on impact. What do you do? Your SYS SQLPLUS session IS able to connect.
How are extents allocated to a segment?
Explain the use of compress option in exp command.
how to join query for one source type is oracle another source type is sql server ?