Skip to content
Advertisement

SQL: Convert integer into formatted hex string

In PostgreSQL, let’s say I have the following table:

I want to convert the myInt column into a formatted string that contains the hex representation of the integer in it and rename the column. So it would look something like the following:

What would the query look like to convert the integer?

Advertisement

Answer

Try the following in PostgreSQL.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement