Why can the order of the output be different when a WHERE clause is used?
If the table in DB2Everyplace has an index over one of the fields, If you use a WHERE clause the, the order of the output may be sorted by the index.
For a query with WHERE clause, since there is index on one of the columns, the record retrieving is performed by index searching. For another query without the where clause, the data file is returned sequentially. To some extent, the later scenario for the resultset order depends or when the record was inserted.
If you want to ensure a consistent order of the resultset on a column, you can always use ORDER BY syntax to sort the resultset.