Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2005
»
Administering
»
Columns of second query appears in diff order...
Columns of second query appears in diff order when use UNION.
Rate Topic
Display Mode
Topic Options
Author
Message
Joy Smith San
Joy Smith San
Posted Wednesday, December 15, 2010 12:12 AM
Ten Centuries
Group: General Forum Members
Last Login: Today @ 3:16 AM
Points: 1,370,
Visits: 2,291
Hi All,
--- Results of first query
Server AppName Version
Srvr1 App1 6.1.1016
Srvr1 App2 6.1.1033
Srvr1 App3 5.7.216
--- Results of second query
Server AppName Version
Srvr2 App4 12.5
--- Results when I UNION the above 2 queries.
Server AppName Version
Srvr1 App1 6.1.1016
Srvr1 App2 6.1.1033
Srvr1 App3 5.7.216
12.5 Srvr2 App4
Why the last row columns (second query results) comes is diff order
Thanks in Advance.
Post #1034918
Mr. Holio
Mr. Holio
Posted Wednesday, December 15, 2010 12:53 AM
SSC Eights!
Group: General Forum Members
Last Login: Friday, May 10, 2013 5:58 PM
Points: 843,
Visits: 2,558
Hi,
Could you post that query?
__________________________
Allzu viel ist ungesund...
Post #1034930
Joy Smith San
Joy Smith San
Posted Wednesday, December 15, 2010 1:11 AM
Ten Centuries
Group: General Forum Members
Last Login: Today @ 3:16 AM
Points: 1,370,
Visits: 2,291
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.
Post #1034936
WayneS
WayneS
Posted Wednesday, December 15, 2010 7:12 AM
SSCertifiable
Group: General Forum Members
Last Login: Today @ 10:05 AM
Points: 6,368,
Visits: 8,231
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.
Wayne
Microsoft Certified Master: SQL Server 2008
If you can't explain to another person how the code that you're copying from the internet works, then
DON'T USE IT
on a production system! After all,
you
will be the one supporting it!
Links:
For better assistance in answering your questions
,
How to ask a question
,
Performance Problems
,
Common date/time routines
,
CROSS-TABS and PIVOT tables Part 1
&
Part 2
,
Using APPLY Part 1
&
Part 2
,
Splitting Delimited Strings
Post #1035119
Joy Smith San
Joy Smith San
Posted Thursday, December 16, 2010 8:40 AM
Ten Centuries
Group: General Forum Members
Last Login: Today @ 3:16 AM
Points: 1,370,
Visits: 2,291
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.
Post #1035892
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.