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 what are acid properties?

1018


What types of replication are supported in sql server?

997


We are updating a field in sql and alter the row also.after giving the commit command the system is crashed.what will happen to the commands given,whether it will update and alter the table or not?

1326


How can you transfer data from a text file to a database table? Or how can you export data from a table to a comma delimited (csv) file? Or how can you import data from ms access to a table in a database? Or how can you export data from a table to an excel file?

969


When setting replication, is it possible to have a publisher as 64 bit sql server and distributor or subscribers as a 32 bit sql server?

893


Where is localdb stored?

888


How to generate create table script on an existing table in ms sql server?

1091


What are different replication agents and what's their purpose? : sql server replication

958


What is the main difference between ‘between’ and ‘in’ condition operators?

1103


What is data block and how to define data block size?

977


What are “phantom rows”?

1608


What is the difference between composite index and covering index?

900


how you can move data or databases between servers and databases in sql server? : Sql server administration

915


What is microsoft sql server?

912


what do you understand by change data capture?

935