Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What are the differences between UNION and JOINS?

Answer Posted / nikhila reddy

UNION:the both tables should have same structure and datatype.
the column name will taken as first table ones it wont bother abt other tables.
example:
emp table as
eid ename esal
1 a 10k
2 b 20k

dept table as
deptid deptname deptsal
11 aa 20k
12 bb 50k


select * from emp
union
select * from dept

empid empname empsal
1 a 10k
2 b 20k
11 aa 20k
12 bb 50k

now u can observe col name taking alias of first table.
no need of relation between a tables.
it will remove duplicate records.


joins:it will join only required fields from different tables.
no need of same structure for tables..
it should have relation between a tables.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Do you know how to send email from database?

1005


explain different types of joins? : Sql server database administration

985


How to scale out a federation by Sql statement?

116


Explain the purpose of indexes?

976


What programming language would you use to create embedded functions in ssrs?

184


what data regions are and what are the different data regions?

141


What are the pros and cons of putting a scalar function in a queries select list or in the where clause?

1217


What is the bookmark lookup and rid lookup?

998


How do you rebuild an identity column?

949


How many replicas are maintained for each SQL Azure database?

142


Explain the xml support sql server extends?

1040


What is the difference between lock, block and deadlock? : sql server database administration

1045


How do I view a script in sql server?

1039


What is the current limitation of the size of SQL Azure DB?

127


Explain subquery and state its properties?

1042