Incorrect "union all" results

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jenniferdb2
    New Member
    • Feb 2009
    • 2

    Incorrect "union all" results

    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
    New Member
    • Jun 2009
    • 13

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

    Comment

    Working...