What is the difference between join and union.

Answer Posted / somashekhar m

Union : The union operator combines the results of two or
more queries into a single result set. But no.of columns
must match in both/all the queries (and also the order)
which are used for union.
Union -- returns with no duplicate rows
Union all -- retruns with duplicate rows (No. of rows
returned = No. of rows in Query1 + No. of rows in Query 2)
Union is a set operator.
You cannot use the union operator within a create view
statement.

You cannot use the union operator on text and image columns.

You cannot use the for browse clause in statements
involving the union operator.

Joins: Joins are used to extract information from more than
one table based on the related column/coloums (PK and RFK)
any no. of rows can be retrived based on matching matching
colums. Different types of joins are Inner join=equi join=
join, outer join(Right outer join/right join, Left outer
join/ left join), Cross join, and full outer join/outer join

Is This Answer Correct ?    139 Yes 20 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which join condition can be specified using on clause?

508


Explain how to use transactions efficiently : transact sql

518


How do I view stored procedures?

532


What is the use of prepared statement?

532


What is pls integer?

577






What is a left inner join?

525


What is a delimiter in sas?

534


Is pl sql better than sql?

540


What is clustered index sql?

495


Is sql developer case sensitive?

510


What is trigger explain with example?

540


Table A Table B 1 1 2 1 3 1. Union & union all --> A Union B , A Union all B 2. Minus , Intersect --> A minus B , B Minus A , A Intersect B 3. Joins A join B , A Left Join B A Right Join B , A full Join B 4. %Type - Uses & Benifit 5. Truncate & Delete 6. Pragma Autonomus Transaction 7. how to Perform DDL from function or procedure 8. Can we have DML inside Function 9. Rank & Dense Rank diffrence 10. Water Mark in Oracle 11. Index , Can we have index in all column of table if no then why ?

526


What can I use instead of union in sql?

503


What are expressions?

553


Explain the types of joins in sql?

563