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
Is oracle sql free?
Explain how exception handling is done in advance pl/sql?
What is data manipulation language?
what is collation? : Sql dba
Is it possible to sort a column using a column alias?
What is the command used to fetch the first 5 characters of a string?
what is the difference between truncate and drop statements? : Sql dba
what is the command line end user interface - mysql? : Sql dba
How to run sql statements through the web interface?
How to read xml file in oracle pl sql?
What is pl sql architecture?
How insert into statements in sql?
How does an execution block start and end in pl sql?
What is java sql drivermanager?
How does join work in sql?