on 01-20-2006 5:54 AM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.