Re: [SQL] convert text to number or number to text

Поиск
Список
Период
Сортировка
От José Soares
Тема Re: [SQL] convert text to number or number to text
Дата
Msg-id 371F1644.2B73C65C@sferacarta.com
обсуждение исходный текст
Ответ на convert text to number or number to text  (JT Kirkpatrick <jt-kirkpatrick@mpsllc.com>)
Список pgsql-sql
This should work:

select cast('123' as int), cast(123 as text);

José


JT Kirkpatrick ha scritto:

> I'm trying to do an update query that compares an int4 field to a variable
> which I think contains a string (it was passed in through cgi.pm).  can I
> convert that string to an integer? - it will always be a number passing
> through.  I vaguely remember oracle having a to_number function - does
> postgres have something similar?
>
> jt



В списке pgsql-sql по дате отправления:

Предыдущее
От: José Soares
Дата:
Сообщение: Re: [SQL] convert text to number or number to text
Следующее
От: Bill Carlson
Дата:
Сообщение: UNION with grouping?