SQL Server Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 1618 Page Views: 

What is the difference between UNION and UNION ALL Statements?



Posted By: Avi Date: 7 October 2009 03:19:40 AM
 Answer:

UNION command selects distinct and related information from two tables while UNION ALL selects all the values from both the tables i.e. UNION statement eliminates duplicate rows while UNION ALL statement includes duplicate rows.

UNION All statement is much faster than UNION because UNION ALL statement does need to filter out the duplicate rows.


Posted By: eTechPlanet


Date: 7 October 2009 03:19:40 AM
Post a better Answer if you have
 
(Will show your Gravatar icon)  
  Country flag

Loading
Enter the text as shown in the image Q0jgRd
Related Questions
SQL Server : Which NET-Libraries are not supported by named instances of SQL Server?

Which NET-Libraries are not supported by named instances of SQL Server?

Multiprotocol , Appletalk , or Banyan vines are the net Libraries supported by named instances. They....
Category: SQL Server Date: 10/1/2010 12:31:08 PM
SQL Server : Which performance monitor counter is used to show the memory used by the process?

Which performance monitor counter is used to show the memory used by the process?

The Performance Monitor Process: Working Set counter shows the amount ofmemory used by a process.
Category: SQL Server Date: 10/1/2010 12:30:08 PM
SQL Server : How many Logical tables are available in the triggers?

How many Logical tables are available in the triggers?

Whenever the triggers are used there exists two logical tables viz. Deleted table and Inserted table....
Category: SQL Server Date: 10/1/2010 12:29:08 PM
SQL Server : Which SQL Statement is used to show fragmentation information for data and indexes of the specified table?
SQL Server : When a table is create with a Primary Key, then what sort of integrity is maintained?

When a table is create with a Primary Key, then what sort of integrity is maintained?

Entity Integrity. As it defines the row as a unique entity for a particular table which is forced by....
Category: SQL Server Date: 10/1/2010 12:27:08 PM