Created
February 15, 2020 05:56
-
-
Save ano/4ca2421a7d6ab430906ef970923aabd7 to your computer and use it in GitHub Desktop.
MySQL Convert UUID to Integer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
The format for converting UUID's to integers is as follows | |
CONV(LEFT(HEX(`uuid_from_bin` (`uuid_v5` (<a static uuid value>,<the uuid field>))),8),16,10) AS id | |
MYSQL User Defined Functions | |
uuid_from_bin | |
and uuid_v5 | |
can be found here https://gist.github.com/ano/60b20726124ffa38571d44cedac61b5d | |
*/ | |
CONV(LEFT(HEX(`uuid_from_bin` (`uuid_v5` ('dd9e93cf-4d32-4f42-9573-7a9989a48e54',`FID`))),8),16,10) AS id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment