Connecting Tech Pros Worldwide Help | Site Map

Incorrect "union all" results

  #1  
Old April 28th, 2009, 07:35 AM
Newbie
 
Join Date: Feb 2009
Posts: 2
Hello All,

create table a (i int);
create table b(i int);
insert into a values(1);
insert into b values(2);
select * from a union all select * from b;

My understanding is the result should be showing at screen as a result
of such 1, 2 ... order but our resulted is showing as 2 1 .on screen.
I tested it on db2, informix, soliddb, mssql, oracle. but db2 only
differ from others. Please let me know why?
  #2  
Old June 14th, 2009, 12:07 PM
przytula's Avatar
Newbie
 
Join Date: Jun 2009
Location: Haacht,Belgium
Posts: 9

re: Incorrect "union all" results


the order can be any order, if not specified
do explain and see, which table is accessed first
best regards, guy przytula
Reply