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 / garima
SELECT (case when a_id > b_id then 'Greater' else 'Lesser'
end), a_id, b_id
FROM (SELECT ROWNUM r_a, account_id a_id
FROM customer) a,
(SELECT ROWNUM r_b, account_id b_id
FROM customer) b
where r_a = r_b+1;
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is blob data type in oracle?
what are the advantages of running a database in archive log mode?
What is a server parameter file in oracle?
How to use like conditions in oracle?
Explain a private synonyms?
How to write a left outer join with the where clause in oracle?
What is a read only transaction in oracle?
Why do you use stored procedures and state some of its disadvantages?
What is a data lock in oracle?
How will you identify oracle database software release?
How to use null as conditions in oracle?
What privilege is needed for a user to create tables in oracle?
Does oracle charge for java?
What is parameterized cursor in oracle?
What are the differences between char and varchar2 in oracle?