I've written a blog Selecting One Row From a Database Table.
There I say for "Selecting a Partly Specified Row":
With UP TO 1 ROWS you tell the database to pass only one row in its tabular result set and the internal table contains only one line. But be aware, that the returned row is not defined. It can be any of those specified by the partial key. In order to get a defined row in respect to the sort order, you can add an ORDER BY clause.
Therefore, the usage of ORDER BY should be perfectly fine in order to circumvent the "DB lottery".
I'd rather guess that the problem here is comparing character fields with numerical values, as Armin has pointed out.