we are using db2 udb v8.1 on windows, i would like to know whether we
have tool or way to compare two tables on same database for data
difference. thanks. (same ddl, different data, try to compare whether
the test output run with right data) 10 27435
"xixi" <da****@yahoo.com> wrote in message
news:c0**************************@posting.google.c om... we are using db2 udb v8.1 on windows, i would like to know whether we have tool or way to compare two tables on same database for data difference. thanks. (same ddl, different data, try to compare whether the test output run with right data)
Do the tables have a primary key or unique index (with no null values)?
On Wed, 30 Jun 2004 21:39:08 UTC, da****@yahoo.com (xixi) wrote: we are using db2 udb v8.1 on windows, i would like to know whether we have tool or way to compare two tables on same database for data difference. thanks. (same ddl, different data, try to compare whether the test output run with right data)
how about something like
select
*
from table_test a
where not exists (
select 1 from original_table b where a.col1 = b.col1 and a.col2 =
b.col2 and a.col3 = b.col3)
--
Lorne Sunley
I usually do:
T1 EXCEPT T2
UNION ALL
T2 EXCEXT T1
Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab da****@yahoo.com (xixi) wrote in message news:<c0**************************@posting.google. com>... we are using db2 udb v8.1 on windows, i would like to know whether we have tool or way to compare two tables on same database for data difference. thanks. (same ddl, different data, try to compare whether the test output run with right data)
You can use EXCEPT operator.
"Serge Rielau" <sr*****@ca.eye-be-em.com> wrote in message
news:cc**********@hanover.torolab.ibm.com... I usually do: T1 EXCEPT T2 UNION ALL T2 EXCEXT T1
EXCEPT ALL is better if your tables have no keys.
and don't forget the brackets otherwise you will be doing
(((T1 EXCEPT ALL T2) UNION ALL T2) EXCEPT ALL T1) !
with a(a) as (values (1), (1),(2))
, b(b) as (values(1),(2),(2))
(select * from a
except ALL
select * from b)
union all
(select * from b
except ALL
select * from a)
;
1
-----------
2
1
2 record(s) selected.
with a(a) as (values (1), (1), (2))
, b(b) as (values(2),(2),(1))
(select * from a
except
select * from b)
union all
(select * from b
except
select * from a)
;
1
-----------
0 record(s) selected.
Regards
Paul Vernon
Business Intelligence, IBM Global Services
Hello,
Can BLOB field of DB2 store TEXT string data ?
Thanks inadvacne !
Shum www.mingyik.com
"Paul Vernon" <pa*********@ukk.ibmm.comm> ¦b¶l¥ó
news:cc***********@gazette.almaden.ibm.com ¤¤¼¶¼g... "Serge Rielau" <sr*****@ca.eye-be-em.com> wrote in message news:cc**********@hanover.torolab.ibm.com... I usually do: T1 EXCEPT T2 UNION ALL T2 EXCEXT T1
EXCEPT ALL is better if your tables have no keys.
and don't forget the brackets otherwise you will be doing (((T1 EXCEPT ALL T2) UNION ALL T2) EXCEPT ALL T1) !
with a(a) as (values (1), (1),(2)) , b(b) as (values(1),(2),(2)) (select * from a except ALL select * from b) union all (select * from b except ALL select * from a) ;
1 ----------- 2 1
2 record(s) selected.
with a(a) as (values (1), (1), (2)) , b(b) as (values(2),(2),(1)) (select * from a except select * from b) union all (select * from b except select * from a) ;
1 -----------
0 record(s) selected.
Regards Paul Vernon Business Intelligence, IBM Global Services
yes , we do have unqiue index on one of the columns.
"Mark A" <no****@nowhere.com> wrote in message news:<cu*****************@news.uswest.net>... "xixi" <da****@yahoo.com> wrote in message news:c0**************************@posting.google.c om... we are using db2 udb v8.1 on windows, i would like to know whether we have tool or way to compare two tables on same database for data difference. thanks. (same ddl, different data, try to compare whether the test output run with right data)
Do the tables have a primary key or unique index (with no null values)?
if i have null value in one of the table column, what should i do?
if i have null value in one of the table column and don't want to
compare it, what should i do?
"Paul Vernon" <pa*********@ukk.ibmm.comm> wrote in message news:<cc***********@gazette.almaden.ibm.com>... "Serge Rielau" <sr*****@ca.eye-be-em.com> wrote in message news:cc**********@hanover.torolab.ibm.com... I usually do: T1 EXCEPT T2 UNION ALL T2 EXCEXT T1
EXCEPT ALL is better if your tables have no keys.
and don't forget the brackets otherwise you will be doing (((T1 EXCEPT ALL T2) UNION ALL T2) EXCEPT ALL T1) !
with a(a) as (values (1), (1),(2)) , b(b) as (values(1),(2),(2)) (select * from a except ALL select * from b) union all (select * from b except ALL select * from a) ;
1 ----------- 2 1
2 record(s) selected.
with a(a) as (values (1), (1), (2)) , b(b) as (values(2),(2),(1)) (select * from a except select * from b) union all (select * from b except select * from a) ;
1 -----------
0 record(s) selected.
Regards Paul Vernon Business Intelligence, IBM Global Services
Shum [MingYik] wrote: Hello,
Can BLOB field of DB2 store TEXT string data ?
Yes, it can. But DB2 will treat it like binary data.
--
Knut Stolze
Information Integration
IBM Germany / University of Jena This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: serge |
last post by:
Is there a stored procedure to allow me to compare two
SQL objects? In my case for example I want to compare
two stored procedures on two different databases?
If there is no SP that does...
|
by: Maur |
last post by:
Hi all,
I have 2 tables say t_OLD and t_NEW. The new has
corrections for audit purposes.
They are identical in all respects (i.e. new is a copy of
old and then changes are made to t_new)
...
|
by: Rachel Curran |
last post by:
Please can anybody help me with the following:
I have two separate excel spreadsheets that I have imported into
access, each sheet holds the same fields. Both spreadsheets hold all
information...
|
by: Megan |
last post by:
Hi everybody-
I'm helping a friend with a music database. She has an old one and is
creating a new one. She wants to compare records and fields in the old
database with records and fields in the...
|
by: Vincent |
last post by:
has any one seen a program to compare mdbs'. I have ran into a few of
them, but none seem to really do that job.
Basically what I need to do is, take 2 access mdb's and check the
differences...
|
by: ethoemmes |
last post by:
I have 2 tables (tblSAPDetails & tblVendorDetails) they both have
Vendor as the PK. I would like to run a query which would highligh the
differences between the 2 tables on 2 fields (ABC and...
|
by: malini |
last post by:
I have two tables
emp - ( has two field)
Name Sal
Joe 45
Jack 50
Kate 67
Dept
Name Dept Sal
Joe IS 46
|
by: cssExp |
last post by:
Hi,
Assume i have two tables. "accounts" and "accounts_logs"
"accounts" (accid, type)
"accounts_log" (accid, ip, timestamp)
Here i want to choose a radom 3 accids from "accounts" if...
|
by: alter.fire |
last post by:
Hey im trying to do the following in PHP:
Connect to 2 different databases, one named complete and one
incomplete.
My goal is to find whats missing in the "incomplete" database.
The fields...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |