在 SQL Server 比較 Uniqueidentifier 大小

http://blogs.msdn.com/b/sqlprogrammability/archive/2006/11/06/how-are-guids-compared-in-sql-server-2005.aspx

簡單做個實驗:

create table #t(c1 uniqueidentifier)
go

insert #t values
( ‘10000000-0000-0000-0000-000000000000’),
( ‘00000001-0000-0000-0000-000000000000’),
( ‘00000000-1000-0000-0000-000000000000’),
( ‘00000000-0001-0000-0000-000000000000’),
( ‘00000000-0000-1000-0000-000000000000’),
( ‘00000000-0000-0001-0000-000000000000’),
( ‘00000000-0000-0000-1000-000000000000’),
( ‘00000000-0000-0000-0001-000000000000’),
( ‘00000000-0000-0000-0000-100000000000’),
( ‘00000000-0000-0000-0000-000000000001’)
go

select * from #t order by c1 desc

結果:

image

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 變更 )

Twitter picture

You are commenting using your Twitter account. Log Out / 變更 )

Facebook照片

You are commenting using your Facebook account. Log Out / 變更 )

Google+ photo

You are commenting using your Google+ account. Log Out / 變更 )

連結到 %s

%d 位部落客按了讚: