Skip to content

Instantly share code, notes, and snippets.

@zonky2
Last active April 16, 2020 15:31
Show Gist options
  • Save zonky2/013066a4e54c8a58c3aa3190a529b3de to your computer and use it in GitHub Desktop.
Save zonky2/013066a4e54c8a58c3aa3190a529b3de to your computer and use it in GitHub Desktop.
unpack uuid to UUID tl_files
# V1 Sven
LCASE(CONCAT_WS('-',
HEX(SUBSTR(uuid, 1, 4)),
HEX(SUBSTR(uuid, 5, 2)),
HEX(SUBSTR(uuid, 7, 2)),
HEX(SUBSTR(uuid, 9, 2)),
HEX(SUBSTR(uuid, 11))
))
# V2 Ingolf
LOWER(CONCAT(
LEFT(HEX(uuid), 8),
'-', MID(HEX(uuid), 9,4),
'-', MID(HEX(uuid), 13,4),
'-', MID(HEX(uuid), 17,4),
'-', RIGHT(HEX(uuid), 12))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment