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 is a table in oracle?
How do you get nicely formatted results from an oracle procedure that returns a reference cursor?
1) WIll all the user get the DEFAULT profile, if their current profile got deleted at any point of time? 2) What are the Situation we need to MOVE the TABLE between T.spaces? 3) What is the use of MOVING the TABLE between SCHEMA'S? 4) What are the Table Clause, Segment Clause and the Datafile Clause which will override each other? 5) Explain SORT_AREA_SIZE of Tempfile to make UNIFORM SIZE
What is a data dictionary and how can it be created?
What is clustered table in Oracle?
What are data pump export and import modes?
Explain a segment?
Database is hung. Old and new user connections alike hang on impact. What do you do? Your SYS SQLPLUS session IS able to connect.
What is a lookup table in oracle?
What are the different types of database objects?
How to create a new table by selecting rows from another table?
How can you use check constraints for self referential integrity?
How do I start tns listener?
How to revoke create session privilege from a user in oracle?
What are the attributes that are found in a cursor?