Take this simple SPQuery for example:
SPQuery query = new SPQuery(); query.Query = "<Where><IsNotNull><FieldRef Name='Modified' /></IsNotNull></Where>"; query.RowLimit = 10;
Notice that "OrderBy" is not defined in the query.
In this case, how are the results of the SPQuery sorted before the top 10 records are selected to be returned?
Will the above query return 10 random items since no "OrderBy" is defined?
EDIT: The reason for this question was a mistake I made where I performed sorting on the query results instead of using "OrderBy" in the query. After setting RowLimit, I could not get the most recently modified items from a list.
The lesson here is to use "OrderBy" instead of sorting the results returned by the query when RowLimit is set.