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

Is pl sql different from sql?

719


Is there any restriction on the use of union in embedded sql?

884


What is rank function in sql?

724


What is benefit of creating memory optimized table?

705


how can we destroy the session, how can we unset the variable of a session? : Sql dba

731






What are sql injection vulnerabilities?

692


What is t sql used for?

733


What is clustered index sql?

700


What trigger means?

730


Is foreign key mandatory?

716


In a distributed database system, can we execute two queries simultaneously?

752


what is not null constraint? : Sql dba

725


How do I order by ascending in sql?

741


What are the events on which a database trigger can be based?

821


Show how functions and procedures are called in a pl/sql block.

768