I'm trying to SELECT data from a table that stores Java UUIDs as binary(16). 
For example, the UUID 76572de1-aa8c-435b-afe4-8e260e19466b looks like this in phpMyAdmin: 0x76572de1aa8c435bafe48e260e19466b. 
Now, how can I query any values from that table by using a simple string?:
SELECT ... WHERE uuid = '76572de1-aa8c-435b-afe4-8e260e19466b'SELECT ... WHERE uuid = '76572de1aa8c435bafe48e260e19466b'SELECT ... WHERE uuid = '0x76572de1-aa8c-435b-afe4-8e260e19466b'SELECT ... WHERE BINARY uuid = '76572de1aa8c435bafe48e260e19466b'SELECT ... WHERE BINARY uuid = '76572de1-aa8c-435b-afe4-8e260e19466b'CONVERT or BINARY keywordsHexadecimal literals in MySQL look like this: X'01AF' or this: 0x01AF (case insensitive in both cases.
One option would be SELECT ... WHERE uuid = X'76572de1aa8c435bafe48e260e19466b'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With