I am surprised to see below results.
String a = '0014K000002axOZQAY';
String b = '0014K000002axOaQAI';
if(a>b){
System.debug('a>b');
} else {
system.debug('b>a');
}
So why 'order by Id asc' is not doing what it is asked to do? On what basis it is ordering Id fields.
PS 1: Created date looks the same but these accounts are created in the same transaction in order so it looks like the query is following the insertion order while I gave "order by Id asc".
PS 2: I read How to query records by insertion order in SOQL? and I hear that we should not rely on order by Id because Ids are in random order, I get that. Still, it doesn't answer why "order by Id asc" doesn't put Ids in ascending order. Only thing I can think of that I should not consider Id same as String so Id follows some other ordering rules, but what they are?
