Quelle est la meilleure façon de trier les enregistrements sur Guid. Ci-dessous ne donne jamais de bons résultats.Tri sur GUID SQL Server 2008
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
Au lieu d'utiliser Guid, comment puis-je générer des entiers séquentiels dans mon select.
Merci
** 1. ** Que voulez-vous dire, il ne donne pas le bon résultat. De quelle façon? ** 2. ** Que signifie la dernière ligne "Au lieu d'utiliser Guid, comment puis-je générer des entiers séquentiels dans mon select." ? –