Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / April 2006

Tip: Looking for answers? Try searching our database.

DB2 Queries

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Pradeep - 16 Apr 2006 14:32 GMT
How we can eliminate duplicate records using SQL query.

Problem is :

Suppose there are two tables: TABLE1 (10 columns) & TABLE2(7 columns).

I need to eliminate duplicate from these two tables. 5 columns are
common in these
tables. With the help of Group By,Order By and Having condition how we
can eliminate
duplicates.
Can anyone give me more information regarding this.

Thanks,
Pradeep
Serge Rielau - 16 Apr 2006 15:07 GMT
> How we can eliminate duplicate records using SQL query.
>
[quoted text clipped - 8 lines]
> duplicates.
> Can anyone give me more information regarding this.
Can you provide example data and output?
Given that you have two tables it's not obvious what you mean by
duplicate records. Also it's important to know whether there is a
primary key.
You are on DB2 zOS?

Cheers
Serge

Signature

Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

m_v_ratnam - 16 Apr 2006 21:00 GMT
select  table1.columns1,
          table1.columns2,
          table1.columns3,
          table1.columns4,
         table1.columns5,
from  TABLE1
union
select  table2.columns1,
          table2.columns2,
          table2.columns3,
          table2.columns4,
         table2.columns5,
from  TABLE2
will reasult in rows with out duplicate records
Pradeep - 25 Apr 2006 17:42 GMT
I will Try this Method and will send feedback ASAP.

Thank You,
Ratnam
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.