what is differece between union and union all

Answer Posted / dinesh waitage

1)Union is used to select distinct values from two tables
where as union all is used to select all values including
duplicates from the tables.

2)UNION - returns on Distinct rows/Slower in performance
UNION ALL.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define full outer join in sql server joins?

578


Can we create clustered index on composite key?

604


1.how to find the dead lock in sql server? 2.How to fine the memory leaks in sql server? 3.suppose transaction log file increasing what action will take ?

1631


You have a table ‘test’ which is a copy of northwind employee table you have written a trigger to update the field ‘hiredate’ with the current date

693


What is key set driven?

615






What is clustered primary key?

644


Can a trigger be created on a view?

651


Where sql server usernames and passwords are stored in a sql server?

573


How do I completely remove sql server instance?

670


Can an automatic recovery be initiated by a user?

656


Is it possible to update the views? If yes, how, if not, why?

625


What is a group function explain with an example?

619


What happens if null values are involved in boolean operations?

637


What is efficiency data?

614


How to sort the query output with order by clauses in ms sql server?

726