在Guid上排序記錄的最佳方法是什麼?以下從未給出正確的結果。在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
改爲使用Guid,我如何在我的選擇中生成順序整數。
感謝
** 1。**你是什麼意思,它沒有給出正確的結果。以什麼方式? ** 2。**最後一行的含義是什麼「取而代之的是使用Guid,我如何在我的選擇中生成順序整數」。 ? – 2010-09-06 23:34:16