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

How to see free space of each tablespace?

1082


Explain a synonym?

1088


Differentiate between function and procedure in oracle.

1154


How to delete an existing row from a table in oracle?

1129


What are set operators?

1137


How to get execution statistics reports on query statements?

1153


How to change system global area (sga) in oracle?

1066


Name the three major set of files on disk that compose a database in Oracle?

1170


Can u please explain me the Discussion on Except ,using cast like type cast. Question in the context of difference between two tables

2118


How to run queries on external tables?

1086


What is difference between cartesian join and cross join?

1157


How to select all columns of all rows from a table in oracle?

1097


What is hot backup and logical backup?

1112


definition of cluster and non-clustered index?

3101


How to convert characters to times in oracle?

1070