We need to compare two successive records of a table based
on a field. For example, if the table is CUSTOMER, and the
filed is Account_ID, To compare Account_IDs of record1 and
record2 of CUSTOMER table, what can be the query ?
Answer Posted / suman rana
select * from
(SELECT account_id , lead(account_id, 1, 0) over (order by
1) nxt_account_id FROM customer)
where account_id = nxt_account_id
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How to insert a record into a table?
How many anonymous blocks can be defined?
How to get a list of all user accounts in the database?
An automatic job running via DBMS_JOB has failedKnowing only that its failed, how do you approach troubleshooting this issue?
What the is the diff between local index and global index. give some example.
What are the differences between date and timestamp in oracle?
What is an oracle cursor variable?
What is a lookup table in oracle?
Is there any function in oracle similar like group_concat of mysql?
What is program global area (pga) in oracle?
Can we save images in a database and if yes, how?
what are archived logs?
How to assign query results to variables?
What are the common oracle dba tasks?
How can we view last record added to a table?