﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Administering / SQL Server 2005  / Columns of second query appears in diff order when use UNION. / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sat, 25 May 2013 06:12:57 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Columns of second query appears in diff order when use UNION.</title><link>http://www.sqlservercentral.com/Forums/Topic1034918-146-1.aspx</link><description>Hi,Thanks for your response.I am sorry that I can't post the query here.I tried to simulate the issue in test, but couldn't. But beleive me, it's a strange problem. And one more thing...When I simply quey using "UNION" this issue occurs.But when I add "top 10 *" with same query, it just works fine.Anyways, when I am free, will try to put those records in some dummy tables and simulate the same error so that I can show you the error.Thanks again.</description><pubDate>Thu, 16 Dec 2010 08:40:47 GMT</pubDate><dc:creator>Joy Smith San</dc:creator></item><item><title>RE: Columns of second query appears in diff order when use UNION.</title><link>http://www.sqlservercentral.com/Forums/Topic1034918-146-1.aspx</link><description>I'd really like to see the query you were running also... from what you've said, this shouldn't be happening. The proof is in the code. I'd be very appreciative if you would post it please.</description><pubDate>Wed, 15 Dec 2010 07:12:33 GMT</pubDate><dc:creator>WayneS</dc:creator></item><item><title>RE: Columns of second query appears in diff order when use UNION.</title><link>http://www.sqlservercentral.com/Forums/Topic1034918-146-1.aspx</link><description>Thanks for your quick reply.Problem resolved. First query is Grouped By "AppName"and second query is Grouped By "Server". When I made first query to be grouped by "Server, AppName' result is coming properly.but, I am still not clear why should it make difference based on the group by columns. I dont understand.Thanks.</description><pubDate>Wed, 15 Dec 2010 01:11:14 GMT</pubDate><dc:creator>Joy Smith San</dc:creator></item><item><title>RE: Columns of second query appears in diff order when use UNION.</title><link>http://www.sqlservercentral.com/Forums/Topic1034918-146-1.aspx</link><description>Hi,Could you post that query?</description><pubDate>Wed, 15 Dec 2010 00:53:19 GMT</pubDate><dc:creator>Mr. Holio</dc:creator></item><item><title>Columns of second query appears in diff order when use UNION.</title><link>http://www.sqlservercentral.com/Forums/Topic1034918-146-1.aspx</link><description>Hi All,---  Results of first queryServer		AppName		VersionSrvr1		App1		6.1.1016Srvr1		App2		6.1.1033Srvr1		App3		5.7.216---  Results of second queryServer		AppName		VersionSrvr2		App4		12.5---  Results when I UNION the above 2 queries.Server		AppName		VersionSrvr1		App1		6.1.1016Srvr1		App2		6.1.1033Srvr1		App3		5.7.216[b]12.5		Srvr2		App4[/b]		Why the last row columns (second query results) comes is diff orderThanks in Advance.</description><pubDate>Wed, 15 Dec 2010 00:12:15 GMT</pubDate><dc:creator>Joy Smith San</dc:creator></item></channel></rss>