what is the difference between union and union all

Answer Posted / praveen k. agrawal

union is used For select distinct values from two tables
where as union all is used For select all values including
duplicates from the tables.

For Example Table X contain values(a,b,c) and Table Y
contain values(c,d,e)
In Case Of Union we will get Result-a,b,c,d,e
and other hand (Union All ) we will get-a,b,c,c,d,e.

Is This Answer Correct ?    23 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are sql triggers used for?

517


How does cross join work?

507


What are the types of optimization?

529


What is the plv (pl/vision) package offers?

625


Are sql connections encrypted?

571






How do I get sql certification?

537


How to check if a column is nullable before setting to nullable?

593


What is a sql*loader control file?

624


How do you change a value in sql?

564


What is the difference between clustered and non-clustered index in sql?

531


What is sql stand for?

579


What is exit statement?

559


Explain the difference between triggers and constraints?

533


Explain what is table in a database?

593


How many types of primary keys are there?

538