Re: cast bool/int

Поиск
Список
Период
Сортировка
От Zdravko Balorda
Тема Re: cast bool/int
Дата
Msg-id 49C7A070.6070600@siix.com
обсуждение исходный текст
Ответ на Re: cast bool/int  (Joshua Tolley <eggyknap@gmail.com>)
Список pgsql-sql
>> CASE WHEN column='t' THEN 1 ELSE 0 END
> 
> Or just CASE WHEN column THEN 1 ELSE 0 END.

In the mean time I've got an elegant solution:

alter ... ... column TYPE smallint USING column::boolean::int::smallint;

It works, you wouldn't beleive it. ;)
Zdravko


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