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 loop through data rows in the implicit cursor?

1082


What is oracle instant client?

1030


How do I connect to oracle database?

1130


What are ddl statements in oracle?

1082


What is a dead lock in oracle?

1134


How would you change old and new values in an insert, delete and update triggers?

1026


Why do I get unexpected characters from 8-bit character sets in weblogic jdriver for oracle?

1092


What is translate in oracle?

1105


What is the difference between hot backup and cold backup in oracle?

1018


What is literal?

1016


How to define an oracle sub procedure?

1152


What are the four Oracle system processes that must always be up and running for the database to be useable?

1023


How remove data files before opening a database?

1080


How to best split csv strings in oracle 9i?

1050


What is oracle thin client?

1029