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
What is embedded sql in db2?
Can cursors be part of a trigger body?
What is $$ in sql?
Can %notfound return null after a fetch?
how to load data files into tables with 'mysqlimport'? : Sql dba
How many sql commands are there?
What is sql architecture?
What is cursor status?
How to start the command-line sql*plus?
What is asqueryable?
what is the difference between delete and truncate commands? : Sql dba
How many types of triggers exist in pl/sql?
What are character functions?
What is self-join and what is the requirement of self-join?
How delete all data from all tables in sql?