Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Comparison of 2 Tables

 
   Database Help (Home) -> Sybase RSS
Next:  SQL2005 is it possible to block access to a singl..  
Author Message
raja

External


Since: Oct 03, 2008
Posts: 52



(Msg. 1) Posted: Fri Oct 03, 2008 9:56 am
Post subject: Comparison of 2 Tables
Archived from groups: comp>databases>sybase (more info?)

Hi,

I have 2 tables.
I have to compare whether the data in those 2 tables are same or not.
( For example : I have to find, how many records different between
those 2 tables, if those tables are almost similar)

How can i find this ?


With Regards,
Raja

 >> Stay informed about: Comparison of 2 Tables 
Back to top
Login to vote
jefftyzzer

External


Since: Jan 14, 2008
Posts: 70



(Msg. 2) Posted: Mon Oct 06, 2008 3:41 pm
Post subject: Re: Comparison of 2 Tables [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Oct 3, 9:56 am, raja wrote:
> Hi,
>
> I have 2 tables.
> I have to compare whether the data in those 2 tables are same or not.
> ( For example : I have to find, how many records different between
> those 2 tables, if those tables are almost similar)
>
> How can i find this ?
>
> With Regards,
> Raja

Hi, Raja

Does (your version of) Sybase support the DIFFERENCE operation (maybe
called MINUS or EXCEPT)? If not, you could do something as ungainly as
export the data to files and compare them using, e.g., diff or CSDiff,
assuming the row count's not prohibitive.

--Jeff

 >> Stay informed about: Comparison of 2 Tables 
Back to top
Login to vote
jefftyzzer

External


Since: Jan 14, 2008
Posts: 70



(Msg. 3) Posted: Mon Oct 06, 2008 4:50 pm
Post subject: Re: Comparison of 2 Tables [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Oct 6, 3:41 pm, jefftyzzer wrote:
> On Oct 3, 9:56 am, raja wrote:
>
> > Hi,
>
> > I have 2 tables.
> > I have to compare whether the data in those 2 tables are same or not.
> > ( For example : I have to find, how many records different between
> > those 2 tables, if those tables are almost similar)
>
> > How can i find this ?
>
> > With Regards,
> > Raja
>
> Hi, Raja
>
> Does (your version of) Sybase support the DIFFERENCE operation (maybe
> called MINUS or EXCEPT)? If not, you could do something as ungainly as
> export the data to files and compare them using, e.g., diff or CSDiff,
> assuming the row count's not prohibitive.
>
> --Jeff

Raja:

Just to help expedite your efforts lest I keep you in suspense,
assuming that Sybase does have DIFFERENCE/MINUS/EXCEPT functionality,
the general pattern for comparing table contents using that method is:

SELECT
COUNT (*)
FROM
(
(
SELECT
*
FROM
table1
MINUS
SELECT
*
FROM
table2
)
UNION
(
SELECT
*
FROM
table2
MINUS
SELECT
*
FROM
table1
)
) X;

--Jeff
 >> Stay informed about: Comparison of 2 Tables 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Text column copy across tables - Hi I have two tables with text columns. I wish to update text column in existing rows in TABLE1 using data present in the text column of a corresponding row in TABLE2. (The row in TABLE2 can be selected without referring to the text column values) ..

Can a view be used inside a derived tables? - Hi all, We have a Nortel symposium telecoms system which uses Sybase to store details of all the calls etc. Now, Symposium does not allow access to the tables so we have to use pre-configed views. There is no problem using this for basic selects. ..

Problem with ASE 12.5 Backup Server - Hello everyone !!! My problem: I have recently installed ASE 12.5 on winxp. When I try to make a dump or load with isql or DBArtisan i get this message: "Can't open a connection to site 'SYB_BACKUP'. See the error log file in the SQL Server boot..

Tuning stored procedures - Hi Everyone; We are working on tuning a compact framework mobile application which uses the Sybase iAnywhere 9.0 as the database. Performance of the stored procedures have been really bad. But we are at our wits end trying to find out the Stored..

PERL DBI Sybase::DBD error --- Dynaloader.pm - Sybase.so - All - I hesitated to post this as I saw many similar postings in my trawlings. However I have been unable to determine the problem in relation to the answers I've seen for the similar problems. Basically I had a working version of DBI and Sybase:DBD..
   Database Help (Home) -> Sybase All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]