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
what are archived logs?
What privilege is needed for a user to insert rows to tables in another schema?
How to fetch the row which has the max value for a column?
What is oracle sid?
what are actual and formal parameters?
What are the limitations oracle database 10g xe?
How to convert csv to table in oracle?
How will you write a query to get a 5th rank student from a table student_report?
What is a nested table?
Why oracle is used?
How to install oracle database 10g xe?
What are the uses of Database Trigger ?
Is java required for oracle client?
How to write text literals in oracle?
What is a read write transaction in oracle?