SQLite生成Guid(uuid)

SELECT
lower(
hex(randomblob(4)) || '-' || hex(randomblob(2)) || '-' || '4' ||
substr(hex( randomblob(2)), 2) || '-' ||
substr('AB89', 1 + (abs(random()) % 4) , 1) ||
substr(hex(randomblob(2)), 2) || '-' ||
hex(randomblob(6))
) GUID

 

posted @ 2024-03-28 09:46  Misterj  阅读(77)  评论(0编辑  收藏  举报