What is the best way to sort records in Guid. The correct results are never given below.
With UIDs As (-- Select ID = 1, UID = NEWID() Union Select ID = 2, UID = NEWID() Union Select ID = 3, UID = NEWID() Union Select ID = 4, UID = NEWID() Union Select ID = 5, UID = NEWID() Union Select ID = 6, UID = NEWID() Union Select ID = 7, UID = NEWID() Union Select ID = 8, UID = NEWID() Union Select ID = 9, UID = NEWID() Union Select ID = 10, UID = NEWID() Union Select ID = 11, UID = NEWID() Union Select ID = 12, UID = NEWID() Union Select ID = 13, UID = NEWID() Union Select ID = 14, UID = NEWID() Union Select ID = 15, UID = NEWID() Union Select ID = 16, UID = NEWID() ) Select * From UIDs Order BY UID, ID
Instead of using Guid, how can I generate consecutive integers in my choice.
thanks
source share