How to sort by id desc with maxResults = 1

I searched within the community for sorting methods. The best example was using the object comparer.

But this is NOT what I need. I want to get the search result already sorted as if you add "ORDER BY ID DESC" to a SQL statement. If you need to load all the results the performance will be "a little bit" bad if you have "some few" entries as you can imagine. Translated into SQL I would like to perform:

SELECT TOP 1 * FROM myObjType WHERE condition AND condition ... ORDER BY id DESC

in order to load only the result matching all conditions and having the highest ID without loading all entries from server - even just one entry.

I didn't found any solution for that.

I need to re-implement the Sequence in the CK utilities because they only work on string based values and not for integer unfortunately.

Beside of that it would be needed for showing the first maybe 50 out of 10.000.000 search result perhaps ordered by creation date descending.