What is the difference between join and union.
Answer Posted / tanu
UNION: Union Combines results of all select statements,
displaying duplicate rows only one time in the answerset.
Rules for usage:
1. All select clauses must have same number of expressions.
2. Corresponding expressions must have compatible domains.
First SELECT statement:
->Determines output format.
->Determines output title.
Last SELECT statement:
->Contains ORDER BY for the entire result, if required.
EXAMPLE:
SELECT first_name
,last_name
,'employee' (TITLE 'employee//type')
FROM employee
WHERE manager_employee_number = 1019
UNION
SELECT first_name
,last_name
,' manager '
FROM employee
WHERE employee_number = 1019
ORDER BY 2
;
RESULT:
first_name last_name employee_type
Carol Kanieski employee
Ron Kubic manager
John Stein employee
JOIN:
Join is a technique for accessing data from more than one
table in a single answerset. Each row in the answerset may
contain data from columns of more than one table. Tables
are joined on columns sharing common domain.
| Is This Answer Correct ? | 11 Yes | 3 No |
Post New Answer View All Answers
Can I create table without primary key?
What is a dirty read sql?
What information is needed to connect sql*plus an oracle server?
What is materialized view in sql?
Name the operator which is used in the query for pattern matching?
Where are my tempfiles, I don't see them in v$datafile or dba_data_file?
What is difference between inner join and self join?
How do I write a sql query in pgadmin 4?
What is dense_rank?
Can I call a procedure inside a function?
How to load data with sql*loader?
What is scalar function in sql?
What is thread join () in threading?
What are the possible values that can be stored in a boolean data field?
Is sql free?