Re: cast bool/int
| От | Marcin Krawczyk |
|---|---|
| Тема | Re: cast bool/int |
| Дата | |
| Msg-id | 95f6bf9b0903230744r69a67a6dk89ba50f3f97603b1@mail.gmail.com обсуждение исходный текст |
| Ответ на | Re: cast bool/int (Achilleas Mantzios <achill@matrix.gatewaynet.com>) |
| Список | pgsql-sql |
This:
SELECT true::integer, false::integer
also works on 8.1
--
regards
mk
SELECT true::integer, false::integer
also works on 8.1
--
regards
mk
2009/3/23 Achilleas Mantzios <achill@matrix.gatewaynet.com>
Στις Monday 23 March 2009 09:59:12 ο/η Zdravko Balorda έγραψε:
>> Hi,Sorry in the above email i meant smth like
> I need a casting operator from boolean to integer,
> tu put in ALTER TABLE statment after USING.
>
CASE WHEN column='t' THEN 1 ELSE 0 END
however
SELECT 't'::boolean::int;
int4
------
1
(1 row)
and
SELECT 'f'::boolean::int;
int4
------
0
(1 row)
work in 8.3
> Any ideas? Thanks.
>
> Zdravko
>
>
--
Achilleas Mantzios
--Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
В списке pgsql-sql по дате отправления: