Created
August 23, 2017 02:39
-
-
Save de314/23ecfd90e521ffb13e5021266d7773a7 to your computer and use it in GitHub Desktop.
SQL HEX
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
SELECT | |
LOWER(CONCAT( | |
SUBSTR(HEX(user_id), 1, 8), '-', | |
SUBSTR(HEX(user_id), 9, 4), '-', | |
SUBSTR(HEX(user_id), 13, 4), '-', | |
SUBSTR(HEX(user_id), 17, 4), '-', | |
SUBSTR(HEX(user_id), 21) | |
)) as userId | |
FROM user | |
WHERE company_id = unhex(replace('9c00fd3e-cd10-4797-8fb8-2fb433690ea6','-','')); | |
# Spring Data | |
# @Column(columnDefinition = "binary(16)", name="user_id", nullable = false) | |
# private UUID userId; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment