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
What is the syntax to add a record to a table?
Does execute immediate commit?
What is the purpose of design view?
What are user defined functions?
What is procedure function?
Is sql microsoft?
How can I speed up sql query?
how can we take a backup of a mysql table and how can we restore it. ? : Sql dba
What is coalesce in sql?
What is sequence in sql?
What is a schema? How is it useful in sql servers?
What are the benefits of pl sql?
What is right join sql?
Is left join inner or outer?
what are the difference between clustered and a non-clustered index? : Sql dba