dbTalk Databases Forums  

Comparison of 2 Tables

comp.databases.sybase comp.databases.sybase


Discuss Comparison of 2 Tables in the comp.databases.sybase forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
jefftyzzer
 
Posts: n/a

Default Re: Comparison of 2 Tables - 10-06-2008 , 06:50 PM






On Oct 6, 3:41*pm, jefftyzzer <jefftyz... (AT) sbcglobal (DOT) net> wrote:
Quote:
On Oct 3, 9:56*am, raja <dextersu... (AT) gmail (DOT) com> 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


Reply With Quote
  #12  
Old   
jefftyzzer
 
Posts: n/a

Default Re: Comparison of 2 Tables - 10-06-2008 , 06:50 PM






On Oct 6, 3:41*pm, jefftyzzer <jefftyz... (AT) sbcglobal (DOT) net> wrote:
Quote:
On Oct 3, 9:56*am, raja <dextersu... (AT) gmail (DOT) com> 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


Reply With Quote
  #13  
Old   
jefftyzzer
 
Posts: n/a

Default Re: Comparison of 2 Tables - 10-06-2008 , 06:50 PM



On Oct 6, 3:41*pm, jefftyzzer <jefftyz... (AT) sbcglobal (DOT) net> wrote:
Quote:
On Oct 3, 9:56*am, raja <dextersu... (AT) gmail (DOT) com> 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


Reply With Quote
  #14  
Old   
jefftyzzer
 
Posts: n/a

Default Re: Comparison of 2 Tables - 10-06-2008 , 06:50 PM



On Oct 6, 3:41*pm, jefftyzzer <jefftyz... (AT) sbcglobal (DOT) net> wrote:
Quote:
On Oct 3, 9:56*am, raja <dextersu... (AT) gmail (DOT) com> 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


Reply With Quote
  #15  
Old   
jefftyzzer
 
Posts: n/a

Default Re: Comparison of 2 Tables - 10-06-2008 , 06:50 PM



On Oct 6, 3:41*pm, jefftyzzer <jefftyz... (AT) sbcglobal (DOT) net> wrote:
Quote:
On Oct 3, 9:56*am, raja <dextersu... (AT) gmail (DOT) com> 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


Reply With Quote
  #16  
Old   
jefftyzzer
 
Posts: n/a

Default Re: Comparison of 2 Tables - 10-06-2008 , 06:50 PM



On Oct 6, 3:41*pm, jefftyzzer <jefftyz... (AT) sbcglobal (DOT) net> wrote:
Quote:
On Oct 3, 9:56*am, raja <dextersu... (AT) gmail (DOT) com> 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


Reply With Quote
  #17  
Old   
jefftyzzer
 
Posts: n/a

Default Re: Comparison of 2 Tables - 10-06-2008 , 06:50 PM



On Oct 6, 3:41*pm, jefftyzzer <jefftyz... (AT) sbcglobal (DOT) net> wrote:
Quote:
On Oct 3, 9:56*am, raja <dextersu... (AT) gmail (DOT) com> 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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.