generate uuid v4 in sqlite

علی ذوالفقار
1402/05/25 06:32:56 (110)
select 
    (lower(hex(randomblob(4))) || '-' || 
     lower(hex(randomblob(2))) || '-4' || 
     substr(lower(hex(randomblob(2))),2) || '-' || 
     substr('89ab',abs(random()) % 4 + 1, 1) || 
     substr(lower(hex(randomblob(2))),2) || '-' || 
     lower(hex(randomblob(6)))) 
as uuid 
Back