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 / manikandan. s

WITH wt AS
(SELECT ROWNUM sl, a.Account_ID
FROM CUSTOMER a)
SELECT a1.*
FROM wt a1, wt a2
WHERE a1.sl = a2.sl + 1 AND a1.col1 = a2.col1
UNION
SELECT a2.*
FROM wt a1, wt a2
WHERE a1.sl = a2.sl + 1 AND a1.col1 = a2.col1

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to login to the server without an instance?

1128


How do we represent comments in oracle?

1012


What is an Oracle index?

1622


How to get a list of all background sessions in the database?

958


Explain drop constraint oracle?

1005


What will be the syntax to find current date and time in format "yyyy-mm-dd"?

982


Typically, where is the conventional directory structure chosen for Oracle binaries to reside?

2091


What are the various oracle database objects?

1106


How translate command is different from replace?

1035


Give the various exception types.

960


Explain the use of grant option in imp command.

973


How can we find out the duplicate values in an oracle table?

1010


What is logical backup in oracle?

983


What do you mean by merge in oracle and how can we merge two tables?

1016


How different is ms access and oracle?

997