Search This Blog

Wednesday, November 14, 2018

UUID in MySQL

You have 2 UUID related functions in MySQL:

UUID_SHORT()Return an integer-valued universal identifier
UUID()Return a Universal Unique Identifier (UUID)
Example usage:

INSERT INTO tbl1 (key, val) VALUES (UUID(), :value)

If you want to remove the '-':

REPLACE(UUID(),'-',''))