Re: Converting yes or no to one letter strings.

Поиск
Список
Период
Сортировка
От Ray O'Donnell
Тема Re: Converting yes or no to one letter strings.
Дата
Msg-id 16b24bb5810.280a.f9dd809031fc0469edf0bbbf79c1d468@rodonnell.ie
обсуждение исходный текст
Ответ на Converting yes or no to one letter strings.  (Lou <lou@dayspringpublisher.com>)
Список pgsql-general


On 4 June 2019 23:30:33 Lou <lou@dayspringpublisher.com> wrote:

Hi everyone,

Is it possible to convert a boolean yes or no field to hold a one letter string? For example, the strings: 's' 'f' 'p' 'e'

To start off, I just need to convert true to 's'. false will have to be manually changed to 'f' or 'p' or 'e' as appropriate.

Lou

select case when (boolean variable) then (whatever) else (whatever else) end;

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

Предыдущее
От: Rich Shepard
Дата:
Сообщение: Re: Converting yes or no to one letter strings.
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Converting yes or no to one letter strings.