<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; Simple Puzzle Using Union and Union All</title>
	<atom:link href="http://blog.sqlauthority.com/2008/03/24/sql-server-simple-puzzle-using-union-and-union-all/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2008/03/24/sql-server-simple-puzzle-using-union-and-union-all/</link>
	<description>Notes of a SQL Server MVP and Database Administrator</description>
	<lastBuildDate>Sat, 21 Nov 2009 05:54:09 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: BD</title>
		<link>http://blog.sqlauthority.com/2008/03/24/sql-server-simple-puzzle-using-union-and-union-all/#comment-52885</link>
		<dc:creator>BD</dc:creator>
		<pubDate>Tue, 09 Jun 2009 17:22:42 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=546#comment-52885</guid>
		<description>The first script would result in:

1
1
2

this is because the union part would run first giving:

1
2

then the union all would run giving you:

1
1
2

The second script woudl result in:

1
2

this is because the union all does not eliminate duplicates and results in:

1
1

then the union part runs which eliminates duplicates and gives

1
2</description>
		<content:encoded><![CDATA[<p>The first script would result in:</p>
<p>1<br />
1<br />
2</p>
<p>this is because the union part would run first giving:</p>
<p>1<br />
2</p>
<p>then the union all would run giving you:</p>
<p>1<br />
1<br />
2</p>
<p>The second script woudl result in:</p>
<p>1<br />
2</p>
<p>this is because the union all does not eliminate duplicates and results in:</p>
<p>1<br />
1</p>
<p>then the union part runs which eliminates duplicates and gives</p>
<p>1<br />
2</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mayank</title>
		<link>http://blog.sqlauthority.com/2008/03/24/sql-server-simple-puzzle-using-union-and-union-all/#comment-45926</link>
		<dc:creator>Mayank</dc:creator>
		<pubDate>Fri, 23 Jan 2009 07:13:41 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=546#comment-45926</guid>
		<description>Script 1
1
1
2

Script 2

1
2</description>
		<content:encoded><![CDATA[<p>Script 1<br />
1<br />
1<br />
2</p>
<p>Script 2</p>
<p>1<br />
2</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karthik.S</title>
		<link>http://blog.sqlauthority.com/2008/03/24/sql-server-simple-puzzle-using-union-and-union-all/#comment-39387</link>
		<dc:creator>Karthik.S</dc:creator>
		<pubDate>Fri, 20 Jun 2008 11:24:53 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=546#comment-39387</guid>
		<description>Script 1#
----------
1
1
2

Script 2#
------------
1
2</description>
		<content:encoded><![CDATA[<p>Script 1#<br />
&#8212;&#8212;&#8212;-<br />
1<br />
1<br />
2</p>
<p>Script 2#<br />
&#8212;&#8212;&#8212;&#8212;<br />
1<br />
2</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: geoff</title>
		<link>http://blog.sqlauthority.com/2008/03/24/sql-server-simple-puzzle-using-union-and-union-all/#comment-34788</link>
		<dc:creator>geoff</dc:creator>
		<pubDate>Wed, 02 Apr 2008 10:04:16 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=546#comment-34788</guid>
		<description>^
First it will do the UNION ALL so the result set would be
1
1

Next it would do a UNION (so it would do a DISTINCT) so the final result set would be.
1
2

Hope it helps,
geoff</description>
		<content:encoded><![CDATA[<p>^<br />
First it will do the UNION ALL so the result set would be<br />
1<br />
1</p>
<p>Next it would do a UNION (so it would do a DISTINCT) so the final result set would be.<br />
1<br />
2</p>
<p>Hope it helps,<br />
geoff</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ashok</title>
		<link>http://blog.sqlauthority.com/2008/03/24/sql-server-simple-puzzle-using-union-and-union-all/#comment-34600</link>
		<dc:creator>ashok</dc:creator>
		<pubDate>Thu, 27 Mar 2008 10:31:52 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=546#comment-34600</guid>
		<description>can u explain how it will produce the result 

1
2


thanks,
ashok</description>
		<content:encoded><![CDATA[<p>can u explain how it will produce the result </p>
<p>1<br />
2</p>
<p>thanks,<br />
ashok</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER - Simple Puzzle Using Union and Union All - Answer Journey to SQL Authority with Pinal Dave</title>
		<link>http://blog.sqlauthority.com/2008/03/24/sql-server-simple-puzzle-using-union-and-union-all/#comment-34563</link>
		<dc:creator>SQL SERVER - Simple Puzzle Using Union and Union All - Answer Journey to SQL Authority with Pinal Dave</dc:creator>
		<pubDate>Tue, 25 Mar 2008 18:34:14 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=546#comment-34563</guid>
		<description>[...] 25, 2008 by pinaldave    Yesterday I posted a puzzle SQL SERVER - Simple Puzzle Using Union and Union All, today we will see the answer of this. Following image explains the answer of [...]</description>
		<content:encoded><![CDATA[<p>[...] 25, 2008 by pinaldave    Yesterday I posted a puzzle SQL SERVER &#8211; Simple Puzzle Using Union and Union All, today we will see the answer of this. Following image explains the answer of [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jerry Hung</title>
		<link>http://blog.sqlauthority.com/2008/03/24/sql-server-simple-puzzle-using-union-and-union-all/#comment-34560</link>
		<dc:creator>Jerry Hung</dc:creator>
		<pubDate>Tue, 25 Mar 2008 14:20:20 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=546#comment-34560</guid>
		<description>#1
1
1
2

#2
1
2

I like UNION ALL :)</description>
		<content:encoded><![CDATA[<p>#1<br />
1<br />
1<br />
2</p>
<p>#2<br />
1<br />
2</p>
<p>I like UNION ALL :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ranu</title>
		<link>http://blog.sqlauthority.com/2008/03/24/sql-server-simple-puzzle-using-union-and-union-all/#comment-34551</link>
		<dc:creator>Ranu</dc:creator>
		<pubDate>Tue, 25 Mar 2008 09:40:56 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=546#comment-34551</guid>
		<description>Answer is 
1
1
2

Union All is faster than Union coz... by default Union apply 
DISTINCT to remove duplicate record in set 
And Union All show all rows including duplicates.</description>
		<content:encoded><![CDATA[<p>Answer is<br />
1<br />
1<br />
2</p>
<p>Union All is faster than Union coz&#8230; by default Union apply<br />
DISTINCT to remove duplicate record in set<br />
And Union All show all rows including duplicates.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Faraz Beg</title>
		<link>http://blog.sqlauthority.com/2008/03/24/sql-server-simple-puzzle-using-union-and-union-all/#comment-34538</link>
		<dc:creator>Faraz Beg</dc:creator>
		<pubDate>Mon, 24 Mar 2008 18:32:12 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=546#comment-34538</guid>
		<description>I forgot to mention that i got the first one right without running it... the second one is helped by Query Analyzer... can&#039;t claim a prize then can I ? :-)</description>
		<content:encoded><![CDATA[<p>I forgot to mention that i got the first one right without running it&#8230; the second one is helped by Query Analyzer&#8230; can&#8217;t claim a prize then can I ? :-)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
