Connecting Tech Pros Worldwide Forums | Help | Site Map

Incorrect "union all" results

Newbie
 
Join Date: Feb 2009
Posts: 2
#1: Apr 28 '09
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?

przytula's Avatar
Newbie
 
Join Date: Jun 2009
Location: Haacht,Belgium
Posts: 9
#2: Jun 14 '09

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