What is the difference between join and union.

Answer Posted / lalitha

join:

The SQL JOIN clause is used whenever we have to select data
from 2 or more tables.
To be able to use SQL JOIN clause to extract data from 2
(or more) tables, we need a relationship between certain
columns in these tables.

union:

The purpose of the SQL UNION command is to combine the
results of two queries together. In this respect, UNION is
somewhat similar to JOIN in that they are both used to
related information from multiple tables. One restriction
of UNION is that all corresponding columns need to be of
the same data type. Also, when using UNION, only distinct
values are selected (similar to SELECT DISTINCT).

Is This Answer Correct ?    35 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between sql and isql*plus?

515


What is the use of double ampersand (&&) in sql queries? Give an example

613


How do I start pl sql?

492


Which normal form is best?

517


what are the differences among rownum, rank and dense_rank? : Sql dba

540






Why do we use view in sql?

536


What does pragma mean?

511


What are the methods of filing?

524


Is sql a dbms?

536


Explain the difference between rename and alias?

543


How bulk collect improves performance?

574


Explain alias in sql?

584


How do I find duplicates in sql?

509


Can we insert in sql function?

551


What is a .db file?

544