Developing Portable Applications : 3. Application Considerations : Implementation Differences : UNION ALL Ordering
 
Share this page                  
UNION ALL Ordering
In DB2 UDB, the order of results on UNION ALL statements is the opposite of Ingres when no ORDER BY clause is present. For example, consider the following statement:
select coll from tab1 union all select coll from tab2
In Ingres, the rows from tab1 are returned first in the query results, followed by the results from tab2. Conversely, in DB2 UDB, the result rows from tab2 are returned first followed by the result rows from tab1.