Last active
November 7, 2019 08:50
-
-
Save Hazem-Ben-Khalfallah/17017e4abb99d5e6dda215fd9e03725b to your computer and use it in GitHub Desktop.
[UUID to string in Mysql] #sql #mysql
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
#MySQL 8 | |
#convert uuid binary(16) to String | |
SELECT BIN_TO_UUID(uuid) FROM foo | |
#convert uuid string to binary(16) | |
SELECT UUID_TO_BIN(UUID()) | |
#MySQL 5,6,7 | |
#convert uuid binary(16) to String | |
SELECT HEX(uuid) FROM foo | |
#convert uuid string to binary(16) | |
SELECT UNHEX(replace(UUID(), '-', '')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment