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
What are privileges and grants?
Can select statements be used on views in oracle?
What are the differences between lov and list item?
What is a schema in oracle?
How to use "if" statements on multiple conditions?
How to assign data of the deleted row to variables?
What is the sql query to concatenate column values from multiple rows in oracle?
How to create a stored function in oracle?
What is the purpose of tables, private synonyms and public synonyms in Oracle?
How to retrieve values from data fields in record variables?
In SAP ECC 6.0 , under DB02 tcode , Tablespace name to be explain stepy step all the col
Who developed oracle & when?
What do you mean by a deadlock?
How do you increase the OS limitation for open files (LINUX and/or Solaris)?
candidate key is subset of super key but not vice-verse explain