Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

comparasion

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Biswajit Nanda

New User


Joined: 28 Mar 2011
Posts: 9
Location: India

PostPosted: Tue May 17, 2011 12:10 pm    Post subject: comparasion
Reply with quote

IS UNINON = OUTER jOIN?
Back to top
View user's profile Send private message

GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1278
Location: Belgium

PostPosted: Tue May 17, 2011 2:05 pm    Post subject:
Reply with quote

no, although some idiots use full outer join when a union is required.
Back to top
View user's profile Send private message
Biswajit Nanda

New User


Joined: 28 Mar 2011
Posts: 9
Location: India

PostPosted: Tue May 17, 2011 2:08 pm    Post subject:
Reply with quote

Please,can you give me details, why its different?
Back to top
View user's profile Send private message
mallik_0279

New User


Joined: 13 Aug 2007
Posts: 4
Location: hyderabad

PostPosted: Tue May 17, 2011 2:12 pm    Post subject: Reply to: comparasion
Reply with quote

hello,

pls post your question clearly..
so that members can help you
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue May 17, 2011 2:22 pm    Post subject:
Reply with quote

As GuyC said "No" -- to take it further, in a join, the matching rows are joined side-by-side to make the result table. By contrast, in a union the matching rows are joined (in a sense) one-above-the-other to make the result table.

Hope you've the answer?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Tue May 17, 2011 2:26 pm    Post subject: Reply to: comparasion
Reply with quote

I like to think the UNION along the lines of a <datatset> CONCATENATION
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Tue May 17, 2011 2:26 pm    Post subject:
Reply with quote

The output record set in union contains same number of columns as in the input tables. But it concatenates all the records of both the input tables in the output. Both the input tables should have the same number of columns and same data types for those columns.

But the full outer join concatenates the columns in both the table. No need for the input tables to have same number of records.
a full outer join combines the results of both left and right outer joins. The joined table will contain all records from both tables, and fill in nulls for missing matches on either side
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1278
Location: Belgium

PostPosted: Tue May 17, 2011 2:56 pm    Post subject:
Reply with quote

gylbharat wrote:
The output record set in union contains same number of columns as in the input tables. But it concatenates all the records of both the input tables in the output. Both the input tables should have the same number of columns and same data types for those columns.

But the full outer join concatenates the columns in both the table. No need for the input tables to have same number of records.
a full outer join combines the results of both left and right outer joins. The joined table will contain all records from both tables, and fill in nulls for missing matches on either side

close, but no cigar.
- The tables in a union don't have to have the same number of columns or "records". The selects in a union must specify the same number and compatible types of columns!
a union will show duplicate rows only once, a union all will show duplicate rows if they exist.
in enrico-sorichetti words :
a union is like concatenate datasets and a sort sumfields=none
a union all is like concatenate datasets

- a full outer join will contain all rows from both tables, but depending on your join condition, the same row can be reported multiple times.
in enrico-sorichetti words : a full outer join is like a 2 datasets merge program.

So functionally different things.
Sure you can do a union using a full outer join and a lot of coding.
Sure you can do a full outer join using a union and a lot of coding.
But that is just stupid.
Back to top
View user's profile Send private message
rakesh1155

New User


Joined: 21 Jan 2009
Posts: 84
Location: India

PostPosted: Tue May 17, 2011 2:56 pm    Post subject:
Reply with quote

The answer is "It is not".
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue May 17, 2011 3:15 pm    Post subject:
Reply with quote

removed by poster.
no need to duplicate guyc's response,
other to add:

and db2 tables do not have records, they have rows.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Comparasion of files with different cond dhiva_karanb DFSORT/ICETOOL 1 Sun Apr 02, 2006 6:11 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us