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 is a database? : Sql dba

610


How do I view a procedure in sql?

549


Why truncate is faster than delete?

566


Why do we use view in sql?

536


How do we accept inputs from user during runtime?

548






Explain constraints in sql?

575


What are the ddl commands?

539


what is a unique key ? : Sql dba

547


State few characteristics of pl/sql?

569


Who is the owner of mysql database?

553


Explain the working of primary key?

614


What is difference between cursor and trigger?

559


Why we use stored procedure instead of query?

540


what is the difference between char_length and length? : Sql dba

574


Define concurrency control. : Transact sql

587