.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> Sql Server >> Post New QuestionBookmark and Share Subscribe to Forum

Difference between UNION and Join in SQL ?

Posted By: Narayanan     Posted Date: August 13, 2012    Points:5   Category :Sql Server
Difference between UNION and Join in SQL ?

Responses
Author: BitWise             
Posted Date: August 23, 2012     Points: 20   

Union makes two queries look like one where as Joins are for examining two or more tables in a single query statement.

BitWise
Author: kamlesh             
Posted Date: August 27, 2012     Points: 20   

Hi,

A join selects columns from 2 or more tables. A union selects rows.

For SQL Union Operator check
http://www.w3schools.com/sql/sql_union.asp
and For SQL Join Check
http://www.w3schools.com/sql/sql_join.asp

Thanks And Regards.
Kamlesh Nikam
Author: Ravi Ranjan Kumar             
Posted Date: August 31, 2012     Points: 20   

UNION puts lines from queries after each other, while JOIN makes a Cartesian product and subsets it.
Have a look at UNION - http://www.w3schools.com/sql/sql_union.asp
and at join - http://www.w3schools.com/sql/sql_join.asp

Thanks & Regards
Ravi Ranjan Kumar
http://raviranjankr.wordpress.com
Author: Narayanan             
Posted Date: September 25, 2012     Points: 20   

Hi,
Thanks

Regards, Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
Author: Narayanan             
Posted Date: September 25, 2012     Points: 20   

Hi,
Thanks

Regards, Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
Author: Steve             
Posted Date: December 07, 2012     Points: 20   

They're completely different things.

A Join allows you to relate similar data in different tables.
A Union returns the results of two different queries as a single recordset.



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend