| От | Doug Quale |
|---|---|
| Тема | Re: Help with converting hexadecimal to decimal |
| Дата | |
| Msg-id | 87sm2bqizf.fsf@charter.net обсуждение исходный текст |
| Ответ на | Re: Help with converting hexadecimal to decimal (Bruce Momjian <pgman@candle.pha.pa.us>) |
| Ответы |
Re: Help with converting hexadecimal to decimal
|
| Список | pgsql-general |
Bruce Momjian <pgman@candle.pha.pa.us> writes: > Chandra Sekhar Surapaneni wrote: > > Hi All, > > Is there a built in function which works exactly the opposite way as > > to_hex(). > > I basically want to convert a a hexadecimal to a decimal. > > Sure: > > test=> SELECT x'10'::integer; > int4 > ------ > 16 > (1 row) That's not the inverse of to_hex(). to_hex() takes an integer and returns text. You've taken the bitstring constant B'10000' and coerced it to integer. The inverse funtion would take the text '10' and return the integer 16.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера