cancel
Showing results for 
Search instead for 
Did you mean: 

Joins and Unions defference

Former Member
0 Kudos

Hi Mates.

Could any one tell me the Basic difference between Joins and Unions . I know InfoSet contain joins and Multiproviders contains the unions.

Regards.

harry

Accepted Solutions (1)

Accepted Solutions (1)

edwin_harpino
Active Contributor
0 Kudos

hi harry,

joins from 2 or more table with criteria match, where unions gather all data, e.g

table a

customer product qty

a y 5

b z 6

table b

customer product qty

a x 10

c z 12

join on a.customer = b.customer

result

customer product qty

a y 5

a x 10

unions

customer product qty

a y 5

b z 6

a x 10

c z 12

there are inner and outer join (left, right).

hope this helps.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Harry,

Let suppose you had two table TAB1 = 10 records and TAB2 = 30.

If you are using the left join based on TAB1 for TAB2 then you will get only 10 only.

If you are using the inner join between tab1 and tab2 then you will get only the combination of records only...(less records)

if you are using the union between the two tables then you will get totaly 40 records.

Regards,

PRK

Message was edited by: PRK

Former Member
0 Kudos

Hello Harry,

Joins only combine values that appear in both tables. In contrast to a union, joins form the intersection of the tables.

reagrds,

Praveen

Former Member
0 Kudos

Hi,

say for ex:

table1: custid , pid , sales

table2: custid , salesrepid.

Now as per <b>joining</b> table1 and 2 as per custid the result has custid, pid and sales ( as per custid of table1=custid of table2).

Union is just collection of all the data with out any condition. i.e, it contains all the records of table1 and table2.

regards,

shylaja.