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


Please Help Members By Posting Answers For Below Questions

Can we store images in oracle database?

555


How would you begin to troubleshoot an ORA-3113 error?

1605


State the difference along with examples between Oracle 9i, Oracle 10g and Oracle 11i.

609


How to use "out" parameter properly?

634


What is key preserved table?

568






what is the scripts in data base?

1607


What do you know about normalization? Explain in detail?

499


How do I know if oracle is installed on windows?

488


How to add a new column to an existing table with a default value?

548


What is blob data type in oracle?

561


How do you bind variables in oracle?

551


How do we get field details of a table?

549


How to define a data source name (dsn) in odbc manager?

531


How to manage transaction isolation level?

564


Explain the use of grant option in imp command.

580