Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is blob data type in oracle?

1125


what are the advantages of running a database in archive log mode?

2205


What is a server parameter file in oracle?

1061


How to use like conditions in oracle?

1063


Explain a private synonyms?

1043


How to write a left outer join with the where clause in oracle?

1087


What is a read only transaction in oracle?

1030


Why do you use stored procedures and state some of its disadvantages?

1028


What is a data lock in oracle?

1134


How will you identify oracle database software release?

1016


How to use null as conditions in oracle?

1086


What privilege is needed for a user to create tables in oracle?

954


Does oracle charge for java?

1060


What is parameterized cursor in oracle?

1157


What are the differences between char and varchar2 in oracle?

1177