assuming that your primary key is company_name, company_year, company_directory
then you could use something like
select a.company_name, a.company_year, a.company_directory
from
COMPANY_DETAIL A,
COMPANY_DETAIL B
where
a.company_name = b.company_name
and a.company_year = b.company_year
and a.company_directory <> b.company_directory
This will produce a list of similar records execpt when
another version exists with a different company_director.
In the future you might be better posting to comp.databases.oracle.
Scott Watson
Oracle DBA
-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of vini sethi
Sent: Friday, August 24, 2001 12:31 PM
To: [EMAIL PROTECTED]
Subject: [OFF TOPIC] Oracle Question : Field with difference
Hi,
I am sorry to post this in the JSP forum.
I wish to compare two records of a table and identify the columns with
different values.
Eg. Table Company_Detail
company_name company_Year company_director
COY_A 1977 Mr.A
COY_A 1977 Mr.B
A comparison of the two records in the table must give column
"company_director" is different.
Typically, record1 and record2 can be got in two objects ;
record1.company_name can be compared with record2.company_name ...
and so on...
but i wonder if there is a method like diff(rec1,rec2) which will return
columns which do not match.
Please let me know , if there is any way to accomplish this using objects or
any other concept.I am using Oracle 8i.
Thanks in advance,
Vini
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets