| От | Carol Cheung |
|---|---|
| Тема | convert column of integer type to time type? |
| Дата | |
| Msg-id | 46828412.8040203@consumercontact.com обсуждение исходный текст |
| Ответы |
Re: convert column of integer type to time type?
|
| Список | pgsql-novice |
Hi,
I want to convert a column of type integer to type 'time without time zone'.
If I have a table with an integer column
some_int
----------
12
345
1622
1
Then, I add a column to the table of type 'time without time zone'
(some_time).
and, I can perform the update:
UPDATE tester SET some_time = CAST (to_char(some_int, 'FM99909:99') AS
time without time zone);
some_int | some_time
----------+-----------
12 | 00:12:00
345 | 03:45:00
1622 | 16:22:00
1 | 00:01:00
My question is: Is it possible to alter the 'some_int' column directly
without having to create a temporary 'some_time' holding column?
Thanks in advance,
C
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера