Re: How to implent the CONVERT ( data_type [ ( length ) ] , expression ) function in PostgreSQL
В списке pgsql-general по дате отправления:
| От | Adrian Klaver |
|---|---|
| Тема | Re: How to implent the CONVERT ( data_type [ ( length ) ] , expression ) function in PostgreSQL |
| Дата | |
| Msg-id | 54564124.1050805@aklaver.com обсуждение исходный текст |
| Ответ на | Re: How to implent the CONVERT ( data_type [ ( length ) ] , expression ) function in PostgreSQL (Emanuel Calvo <emanuel.calvo@2ndquadrant.com>) |
| Список | pgsql-general |
On 11/02/2014 06:13 AM, Emanuel Calvo wrote: > > El 02/11/14 a las 07:15, rohtodeveloper escibió: >> Dear >> >> I'm doing a job about converting an expression of one data type to >> another. >> In SQLServer, there'are two functions to do this job. >> > >From which data_type to which one? In psql, the option \dC, will give > you the list of supported casts. > > Did you try the cast operand? > > postgres=# select '1235'::int , 823::text, (now()::date)::text; > int4 | text | now > ------+------+------------ > 1235 | 823 | 2014-11-02 > (1 row) In addition if you are trying to do this in/to a table column there is: http://www.postgresql.org/docs/9.3/interactive/sql-altertable.html ALTER [ COLUMN ] column_name [ SET DATA ] TYPE data_type [ COLLATE collation ] [ USING expression ] > > > -- Adrian Klaver adrian.klaver@aklaver.com
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера