Subject Re: [Firebird-Java] Jaybird and SELECTs with ORDER BY
Author Roman Rokytskyy
> To be specific the results I get in IB Expert are sorted stable - i.e.
> parts that were not affected by ORDER BY remain in place, in the order
> they were added to the table.
> The same SQL SELECT query in my Java app returns results which are not
> stable sorted - some rows are in reverse entered-to-table order.

Strange. In general, Jaybird respects (or should respect, at least
nothing was coded differently) the order in which data are returned from
the server...

Can you also check in isql, in what order it returns the data for your
query?

> I can overcome the problem by expanding Java app SELECT query with
> primary key ORDER BY clause, because in general the pk increases as
> the rows are added, but there could be exceptions, as always...

In general you should not rely on the order of not ordered columns. :)

Why can't you add those columns to the ORDER BY clause?

Roman