order of inserting record is mismatching
If you don't specify an order by clause your RDBMS is free to return the results as it chooses. Usually it will return the results in the order it can retrieve the records the fastest.

Since you have the column codGenLedger as the clustered key the records will be stored ordered by codGenLedger physically on disk (unless your indexes are fragmented, but they are still read in that order).

Your RDBMS will most likely do a clustered index scan in your example and return your results ordered by the clustered index.

See this sqlfiddle for a sql server example.

That is actually sorted by your uniqueidentifier, it doesn't look like it when you look at it alphabetically but it is sorted by the hex representation of the binary data.

See here for a complete explanation.


  In fact, the data is sorted; it's just not sorted the way you expect.
  SQL Server displays globally unique identifier (GUID) data as a series
  of alphanumeric strings, but the uniqueidentifier data type is
  equivalent to the binary(16) data type. The GUID value you see is
  simply the hexadecimal representation of the binary value. So the data
  is sorted by this hex representation, not alphabetically.