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 difference between delete and truncate commands? : Sql dba
How many disk partitions should I have?
Do prepared statements prevent sql injection?
What do you understand by case manipulation functions?
What is before trigger?
Why truncate is used in sql?
what is a tablespace? : Sql dba
How do I run a sql trace?
What do we need to check in database testing?
What is the need of a partition key?
What is sql*plus?
How to use distinct and count in sql query? Explain
What is %rowtype in pl sql?
What are the types pl/sql code blocks?
What is nvl?