3

I queried

SELECT Id, Name FROM User LIMIT 10

It generates list of 10 users in some order randomly. On what basis does Salesforce give these 10 records? Ordered by CreatedBy ASC? DESC? Name ASC? DESC? But no, it doesn't satisfy any of these conditions!!

But to my surprise every time I execute this, I get the same results. So, there must be some default ORDER BY. Can anyone please let me know!

0
1

If you read "Order By" documentation it clearly says "There is no guarantee of the order of results unless you use an ORDER BY clause in a query. " It is undefined to get the result in desire order you need to add Order By statement in your query.

Not the answer you're looking for? Browse other questions tagged or ask your own question.